authorgravatar for 2119212+jsoref@users.noreply.github.comJosh Soref <2119212+jsoref@users.noreply.github.com> 2021-09-24 13:39:20-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2021-09-24 13:39:20-04:00
log664941bf14cad3e62b453f83153ca4b65606707b
tree776a9f1b32a06e6cc71be4dd77f72f80be01e1b2
parentef7fa76001f873824b0f64dfc2172ed2f304c348
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Spelling corrections (#9833)

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>

38 files changed, 97 insertions(+), 97 deletions(-)

ci/azure/windows_msvc_script.bat+1-1
......@@ -1,7 +1,7 @@
11@echo on
22SET "SRCROOT=%cd%"
33SET "PREVPATH=%PATH%"
4SET "PREVMSYSEM=%MSYSTEM%"
4SET "PREVMSYSTEM=%MSYSTEM%"
55
66set "PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem"
77SET "MSYSTEM=MINGW64"
doc/langref.html.in+12-12
......@@ -2125,7 +2125,7 @@ fn dump(args: anytype) !void {
21252125
21262126 {#header_open|Multidimensional Arrays#}
21272127 <p>
2128 Mutlidimensional arrays can be created by nesting arrays:
2128 Multidimensional arrays can be created by nesting arrays:
21292129 </p>
21302130 {#code_begin|test|multidimensional#}
21312131const std = @import("std");
......@@ -2898,7 +2898,7 @@ fn bar(x: *const u3) u3 {
28982898}
28992899 {#code_end#}
29002900 <p>
2901 In this case, the function {#syntax#}bar{#endsyntax#} cannot be called becuse the pointer
2901 In this case, the function {#syntax#}bar{#endsyntax#} cannot be called because the pointer
29022902 to the non-ABI-aligned field mentions the bit offset, but the function expects an ABI-aligned pointer.
29032903 </p>
29042904 <p>
......@@ -5549,7 +5549,7 @@ test "coerce to optionals" {
55495549}
55505550 {#code_end#}
55515551 <p>It works nested inside the {#link|Error Union Type#}, too:</p>
5552 {#code_begin|test|test_corerce_optional_wrapped_error_union#}
5552 {#code_begin|test|test_coerce_optional_wrapped_error_union#}
55535553const std = @import("std");
55545554const expect = std.testing.expect;
55555555
......@@ -7669,7 +7669,7 @@ test "main" {
76697669}
76707670 {#code_end#}
76717671 <p>
7672 will ouput:
7672 will output:
76737673 </p>
76747674 <p>
76757675 If all {#syntax#}@compileLog{#endsyntax#} calls are removed or
......@@ -7786,7 +7786,7 @@ test "main" {
77867786 the tag value is used as the enumeration value.
77877787 </p>
77887788 <p>
7789 If there is only one possible enum value, the resut is a {#syntax#}comptime_int{#endsyntax#}
7789 If there is only one possible enum value, the result is a {#syntax#}comptime_int{#endsyntax#}
77907790 known at {#link|comptime#}.
77917791 </p>
77927792 {#see_also|@intToEnum#}
......@@ -8736,7 +8736,7 @@ fn doTheTest() !void {
87368736 {#header_open|@sin#}
87378737 <pre>{#syntax#}@sin(value: anytype) @TypeOf(value){#endsyntax#}</pre>
87388738 <p>
8739 Sine trigometric function on a floating point number. Uses a dedicated hardware instruction
8739 Sine trigonometric function on a floating point number. Uses a dedicated hardware instruction
87408740 when available.
87418741 </p>
87428742 <p>
......@@ -8747,7 +8747,7 @@ fn doTheTest() !void {
87478747 {#header_open|@cos#}
87488748 <pre>{#syntax#}@cos(value: anytype) @TypeOf(value){#endsyntax#}</pre>
87498749 <p>
8750 Cosine trigometric function on a floating point number. Uses a dedicated hardware instruction
8750 Cosine trigonometric function on a floating point number. Uses a dedicated hardware instruction
87518751 when available.
87528752 </p>
87538753 <p>
......@@ -10325,7 +10325,7 @@ pub fn main() void {
1032510325 <p>
1032610326 Some C constructs cannot be translated to Zig - for example, <em>goto</em>,
1032710327 structs with bitfields, and token-pasting macros. Zig employs <em>demotion</em> to allow translation
10328 to continue in the face of non-translateable entities.
10328 to continue in the face of non-translatable entities.
1032910329 </p>
1033010330 <p>
1033110331 Demotion comes in three varieties - {#link|opaque#}, <em>extern</em>, and
......@@ -10335,13 +10335,13 @@ pub fn main() void {
1033510335 Functions that contain opaque types or code constructs that cannot be translated will be demoted
1033610336 to {#syntax#}extern{#endsyntax#} declarations.
1033710337
10338 Thus, non-translateable types can still be used as pointers, and non-translateable functions
10338 Thus, non-translatable types can still be used as pointers, and non-translatable functions
1033910339 can be called so long as the linker is aware of the compiled function.
1034010340 </p>
1034110341 <p>
1034210342 {#syntax#}@compileError{#endsyntax#} is used when top-level definitions (global variables,
1034310343 function prototypes, macros) cannot be translated or demoted. Since Zig uses lazy analysis for
10344 top-level declarations, untranslateable entities will not cause a compile error in your code unless
10344 top-level declarations, untranslatable entities will not cause a compile error in your code unless
1034510345 you actually use them.
1034610346 </p>
1034710347 {#see_also|opaque|extern|@compileError#}
......@@ -10353,7 +10353,7 @@ pub fn main() void {
1035310353 can be translated to Zig. Macros that cannot be translated will be be demoted to
1035410354 {#syntax#}@compileError{#endsyntax#}. Note that C code which <em>uses</em> macros will be
1035510355 translated without any additional issues (since Zig operates on the pre-processed source
10356 with macros expanded). It is merely the macros themselves which may not be translateable to
10356 with macros expanded). It is merely the macros themselves which may not be translatable to
1035710357 Zig.
1035810358 </p>
1035910359 <p>Consider the following example:</p>
......@@ -10373,7 +10373,7 @@ pub export fn foo() c_int {
1037310373}
1037410374pub const MAKELOCAL = @compileError("unable to translate C expr: unexpected token .Equal"); // macro.c:1:9
1037510375 {#code_end#}
10376 <p>Note that {#syntax#}foo{#endsyntax#} was translated correctly despite using a non-translateable
10376 <p>Note that {#syntax#}foo{#endsyntax#} was translated correctly despite using a non-translatable
1037710377 macro. {#syntax#}MAKELOCAL{#endsyntax#} was demoted to {#syntax#}@compileError{#endsyntax#} since
1037810378 it cannot be expressed as a Zig function; this simply means that you cannot directly use
1037910379 {#syntax#}MAKELOCAL{#endsyntax#} from Zig.
src/AstGen.zig+2-2
......@@ -197,7 +197,7 @@ pub const ResultLoc = union(enum) {
197197 none_or_ref,
198198 /// The expression will be coerced into this type, but it will be evaluated as an rvalue.
199199 ty: Zir.Inst.Ref,
200 /// Same as `ty` but it is guaranteed that Sema will additionall perform the coercion,
200 /// Same as `ty` but it is guaranteed that Sema will additionally perform the coercion,
201201 /// so no `as` instruction needs to be emitted.
202202 coerced_ty: Zir.Inst.Ref,
203203 /// The expression must store its result into this typed pointer. The result instruction
......@@ -479,7 +479,7 @@ fn lvalExpr(gz: *GenZir, scope: *Scope, node: Ast.Node.Index) InnerError!Zir.Ins
479479 return expr(gz, scope, .ref, node);
480480}
481481
482/// Turn Zig AST into untyped ZIR istructions.
482/// Turn Zig AST into untyped ZIR instructions.
483483/// When `rl` is discard, ptr, inferred_ptr, or inferred_ptr, the
484484/// result instruction can be used to inspect whether it is isNoReturn() but that is it,
485485/// it must otherwise not be used.
src/Compilation.zig+1-1
......@@ -812,7 +812,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
812812
813813 const needs_c_symbols = !options.skip_linker_dependencies and is_exe_or_dyn_lib;
814814
815 // WASI-only. Resolve the optinal exec-model option, defaults to command.
815 // WASI-only. Resolve the optional exec-model option, defaults to command.
816816 const wasi_exec_model = if (options.target.os.tag != .wasi) undefined else options.wasi_exec_model orelse .command;
817817
818818 const comp: *Compilation = comp: {
src/Liveness.zig+1-1
......@@ -30,7 +30,7 @@ tomb_bits: []usize,
3030/// The main tomb bits are still used and the extra ones are starting with the lsb of the
3131/// value here.
3232special: std.AutoHashMapUnmanaged(Air.Inst.Index, u32),
33/// Auxilliary data. The way this data is interpreted is determined contextually.
33/// Auxiliary data. The way this data is interpreted is determined contextually.
3434extra: []const u32,
3535
3636/// Trailing is the set of instructions whose lifetimes end at the start of the then branch,
src/Module.zig+7-7
......@@ -2188,39 +2188,39 @@ pub const LazySrcLoc = union(enum) {
21882188 node_offset_bin_op: i32,
21892189 /// The source location points to the LHS of a binary expression, found
21902190 /// by taking this AST node index offset from the containing Decl AST node,
2191 /// which points to a binary expression AST node. Next, nagivate to the LHS.
2191 /// which points to a binary expression AST node. Next, navigate to the LHS.
21922192 /// The Decl is determined contextually.
21932193 node_offset_bin_lhs: i32,
21942194 /// The source location points to the RHS of a binary expression, found
21952195 /// by taking this AST node index offset from the containing Decl AST node,
2196 /// which points to a binary expression AST node. Next, nagivate to the RHS.
2196 /// which points to a binary expression AST node. Next, navigate to the RHS.
21972197 /// The Decl is determined contextually.
21982198 node_offset_bin_rhs: i32,
21992199 /// The source location points to the operand of a switch expression, found
22002200 /// by taking this AST node index offset from the containing Decl AST node,
2201 /// which points to a switch expression AST node. Next, nagivate to the operand.
2201 /// which points to a switch expression AST node. Next, navigate to the operand.
22022202 /// The Decl is determined contextually.
22032203 node_offset_switch_operand: i32,
22042204 /// The source location points to the else/`_` prong of a switch expression, found
22052205 /// by taking this AST node index offset from the containing Decl AST node,
2206 /// which points to a switch expression AST node. Next, nagivate to the else/`_` prong.
2206 /// which points to a switch expression AST node. Next, navigate to the else/`_` prong.
22072207 /// The Decl is determined contextually.
22082208 node_offset_switch_special_prong: i32,
22092209 /// The source location points to all the ranges of a switch expression, found
22102210 /// by taking this AST node index offset from the containing Decl AST node,
2211 /// which points to a switch expression AST node. Next, nagivate to any of the
2211 /// which points to a switch expression AST node. Next, navigate to any of the
22122212 /// range nodes. The error applies to all of them.
22132213 /// The Decl is determined contextually.
22142214 node_offset_switch_range: i32,
22152215 /// The source location points to the calling convention of a function type
22162216 /// expression, found by taking this AST node index offset from the containing
2217 /// Decl AST node, which points to a function type AST node. Next, nagivate to
2217 /// Decl AST node, which points to a function type AST node. Next, navigate to
22182218 /// the calling convention node.
22192219 /// The Decl is determined contextually.
22202220 node_offset_fn_type_cc: i32,
22212221 /// The source location points to the return type of a function type
22222222 /// expression, found by taking this AST node index offset from the containing
2223 /// Decl AST node, which points to a function type AST node. Next, nagivate to
2223 /// Decl AST node, which points to a function type AST node. Next, navigate to
22242224 /// the return type node.
22252225 /// The Decl is determined contextually.
22262226 node_offset_fn_type_ret_ty: i32,
src/Sema.zig+3-3
......@@ -11164,7 +11164,7 @@ fn getBuiltinType(
1116411164}
1116511165
1116611166/// There is another implementation of this in `Type.onePossibleValue`. This one
11167/// in `Sema` is for calling during semantic analysis, and peforms field resolution
11167/// in `Sema` is for calling during semantic analysis, and performs field resolution
1116811168/// to get the answer. The one in `Type` is for calling during codegen and asserts
1116911169/// that the types are already resolved.
1117011170fn typeHasOnePossibleValue(
......@@ -11541,7 +11541,7 @@ fn analyzeComptimeAlloc(
1154111541
1154211542/// The places where a user can specify an address space attribute
1154311543pub const AddressSpaceContext = enum {
11544 /// A function is specificed to be placed in a certain address space.
11544 /// A function is specified to be placed in a certain address space.
1154511545 function,
1154611546
1154711547 /// A (global) variable is specified to be placed in a certain address space.
......@@ -11553,7 +11553,7 @@ pub const AddressSpaceContext = enum {
1155311553 /// In contrast to .variable, values placed in this address space are not required to be mutable.
1155411554 constant,
1155511555
11556 /// A pointer is ascripted to point into a certian address space.
11556 /// A pointer is ascripted to point into a certain address space.
1155711557 pointer,
1155811558};
1155911559
src/codegen.zig+7-7
......@@ -985,7 +985,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
985985 // increasing the pc
986986 const d_pc_p9 = @intCast(i64, delta_pc) - quant;
987987 if (d_pc_p9 > 0) {
988 // minus one becaue if its the last one, we want to leave space to change the line which is one quanta
988 // minus one because if its the last one, we want to leave space to change the line which is one quanta
989989 try dbg_out.dbg_line.append(@intCast(u8, @divExact(d_pc_p9, quant) + 128) - quant);
990990 if (dbg_out.pcop_change_index.*) |pci|
991991 dbg_out.dbg_line.items[pci] += 1;
......@@ -1919,15 +1919,15 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
19191919 },
19201920 .shl => {
19211921 assert(!swap_lhs_and_rhs);
1922 const shift_amout = switch (operand) {
1922 const shift_amount = switch (operand) {
19231923 .Register => |reg_op| Instruction.ShiftAmount.reg(@intToEnum(Register, reg_op.rm)),
19241924 .Immediate => |imm_op| Instruction.ShiftAmount.imm(@intCast(u5, imm_op.imm)),
19251925 };
1926 writeInt(u32, try self.code.addManyAsArray(4), Instruction.lsl(.al, dst_reg, op1, shift_amout).toU32());
1926 writeInt(u32, try self.code.addManyAsArray(4), Instruction.lsl(.al, dst_reg, op1, shift_amount).toU32());
19271927 },
19281928 .shr => {
19291929 assert(!swap_lhs_and_rhs);
1930 const shift_amout = switch (operand) {
1930 const shift_amount = switch (operand) {
19311931 .Register => |reg_op| Instruction.ShiftAmount.reg(@intToEnum(Register, reg_op.rm)),
19321932 .Immediate => |imm_op| Instruction.ShiftAmount.imm(@intCast(u5, imm_op.imm)),
19331933 };
......@@ -1936,7 +1936,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
19361936 .signed => Instruction.asr,
19371937 .unsigned => Instruction.lsr,
19381938 };
1939 writeInt(u32, try self.code.addManyAsArray(4), shr(.al, dst_reg, op1, shift_amout).toU32());
1939 writeInt(u32, try self.code.addManyAsArray(4), shr(.al, dst_reg, op1, shift_amount).toU32());
19401940 },
19411941 else => unreachable, // not a binary instruction
19421942 }
......@@ -3618,7 +3618,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
36183618 try self.blocks.putNoClobber(self.gpa, inst, .{
36193619 // A block is a setup to be able to jump to the end.
36203620 .relocs = .{},
3621 // It also acts as a receptical for break operands.
3621 // It also acts as a receptacle for break operands.
36223622 // Here we use `MCValue.none` to represent a null value so that the first
36233623 // break instruction will choose a MCValue for the block result and overwrite
36243624 // this field. Following break instructions will use that MCValue to put their
......@@ -3672,7 +3672,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
36723672 return self.fail("TODO: enable larger branch offset", .{});
36733673 }
36743674 },
3675 else => unreachable, // attempting to perfrom an ARM relocation on a non-ARM target arch
3675 else => unreachable, // attempting to perform an ARM relocation on a non-ARM target arch
36763676 }
36773677 },
36783678 }
src/codegen/arm.zig+1-1
......@@ -2,7 +2,7 @@ const std = @import("std");
22const DW = std.dwarf;
33const testing = std.testing;
44
5/// The condition field specifies the flags neccessary for an
5/// The condition field specifies the flags necessary for an
66/// Instruction to be executed
77pub const Condition = enum(u4) {
88 /// equal
src/codegen/llvm.zig+1-1
......@@ -1161,7 +1161,7 @@ pub const FuncGen = struct {
11611161 /// in other instructions. This table is cleared before every function is generated.
11621162 func_inst_table: std.AutoHashMapUnmanaged(Air.Inst.Index, *const llvm.Value),
11631163
1164 /// These fields are used to refer to the LLVM value of the function paramaters
1164 /// These fields are used to refer to the LLVM value of the function parameters
11651165 /// in an Arg instruction.
11661166 args: []*const llvm.Value,
11671167 arg_index: usize,
src/codegen/spirv.zig+2-2
......@@ -260,7 +260,7 @@ pub const DeclGen = struct {
260260 };
261261 }
262262
263 /// Generate the code for `decl`. If a reportable error occured during code generation,
263 /// Generate the code for `decl`. If a reportable error occurred during code generation,
264264 /// a message is returned by this function. Callee owns the memory. If this function
265265 /// returns such a reportable error, it is valid to be called again for a different decl.
266266 pub fn gen(self: *DeclGen, decl: *Decl, air: Air, liveness: Liveness) !?*Module.ErrorMsg {
......@@ -565,7 +565,7 @@ pub const DeclGen = struct {
565565 }
566566 },
567567 // When recursively generating a type, we cannot infer the pointer's storage class. See genPointerType.
568 .Pointer => return self.fail("Cannot create pointer with unkown storage class", .{}),
568 .Pointer => return self.fail("Cannot create pointer with unknown storage class", .{}),
569569 .Vector => {
570570 // Although not 100% the same, Zig vectors map quite neatly to SPIR-V vectors (including many integer and float operations
571571 // which work on them), so simply use those.
src/codegen/wasm.zig+3-3
......@@ -1005,7 +1005,7 @@ pub const Context = struct {
10051005 const rhs = self.resolveInst(bin_op.rhs);
10061006
10071007 // it's possible for both lhs and/or rhs to return an offset as well,
1008 // in which case we return the first offset occurance we find.
1008 // in which case we return the first offset occurrence we find.
10091009 const offset = blk: {
10101010 if (lhs == .code_offset) break :blk lhs.code_offset;
10111011 if (rhs == .code_offset) break :blk rhs.code_offset;
......@@ -1031,7 +1031,7 @@ pub const Context = struct {
10311031 const rhs = self.resolveInst(bin_op.rhs);
10321032
10331033 // it's possible for both lhs and/or rhs to return an offset as well,
1034 // in which case we return the first offset occurance we find.
1034 // in which case we return the first offset occurrence we find.
10351035 const offset = blk: {
10361036 if (lhs == .code_offset) break :blk lhs.code_offset;
10371037 if (rhs == .code_offset) break :blk rhs.code_offset;
......@@ -1395,7 +1395,7 @@ pub const Context = struct {
13951395 }
13961396
13971397 // We map every block to its block index.
1398 // We then determine how far we have to jump to it by substracting it from current block depth
1398 // We then determine how far we have to jump to it by subtracting it from current block depth
13991399 const idx: u32 = self.block_depth - self.blocks.get(br.block_inst).?;
14001400 const writer = self.code.writer();
14011401 try writer.writeByte(wasm.opcode(.br));
src/link/Coff.zig+3-3
......@@ -50,7 +50,7 @@ last_text_block: ?*TextBlock = null,
5050section_table_offset: u32 = 0,
5151/// Section data file pointer.
5252section_data_offset: u32 = 0,
53/// Optiona header file pointer.
53/// Optional header file pointer.
5454optional_header_offset: u32 = 0,
5555
5656/// Absolute virtual address of the offset table when the executable is loaded in memory.
......@@ -602,7 +602,7 @@ fn writeOffsetTableEntry(self: *Coff, index: usize) !void {
602602 const current_virtual_size = mem.alignForwardGeneric(u32, self.offset_table_size, section_alignment);
603603 const new_virtual_size = mem.alignForwardGeneric(u32, new_raw_size, section_alignment);
604604 // If we had to move in the virtual address space, we need to fix the VAs in the offset table, as well as the virtual address of the `.text` section
605 // and the virutal size of the `.got` section
605 // and the virtual size of the `.got` section
606606
607607 if (new_virtual_size != current_virtual_size) {
608608 log.debug("growing offset table from virtual size {} to {}\n", .{ current_virtual_size, new_virtual_size });
......@@ -980,7 +980,7 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void {
980980 const full_out_path = try directory.join(arena, &[_][]const u8{self.base.options.emit.?.sub_path});
981981
982982 if (self.base.options.output_mode == .Obj) {
983 // LLD's COFF driver does not support the equvialent of `-r` so we do a simple file copy
983 // LLD's COFF driver does not support the equivalent of `-r` so we do a simple file copy
984984 // here. TODO: think carefully about how we can avoid this redundant operation when doing
985985 // build-obj. See also the corresponding TODO in linkAsArchive.
986986 const the_object_path = blk: {
src/link/MachO.zig+4-4
......@@ -213,7 +213,7 @@ decls: std.AutoArrayHashMapUnmanaged(*Module.Decl, void) = .{},
213213
214214/// Currently active Module.Decl.
215215/// TODO this might not be necessary if we figure out how to pass Module.Decl instance
216/// to codegen.genSetReg() or alterntively move PIE displacement for MCValue{ .memory = x }
216/// to codegen.genSetReg() or alternatively move PIE displacement for MCValue{ .memory = x }
217217/// somewhere else in the codegen.
218218active_decl: ?*Module.Decl = null,
219219
......@@ -512,7 +512,7 @@ pub fn flush(self: *MachO, comp: *Compilation) !void {
512512 const full_out_path = try directory.join(arena, &[_][]const u8{self.base.options.emit.?.sub_path});
513513
514514 if (self.base.options.output_mode == .Obj) {
515 // LLD's MachO driver does not support the equvialent of `-r` so we do a simple file copy
515 // LLD's MachO driver does not support the equivalent of `-r` so we do a simple file copy
516516 // here. TODO: think carefully about how we can avoid this redundant operation when doing
517517 // build-obj. See also the corresponding TODO in linkAsArchive.
518518 const the_object_path = blk: {
......@@ -2245,7 +2245,7 @@ pub fn createStubAtom(self: *MachO, laptr_sym_index: u32) !*Atom {
22452245fn createTentativeDefAtoms(self: *MachO) !void {
22462246 if (self.tentatives.count() == 0) return;
22472247 // Convert any tentative definition into a regular symbol and allocate
2248 // text blocks for each tentative defintion.
2248 // text blocks for each tentative definition.
22492249 while (self.tentatives.popOrNull()) |entry| {
22502250 const match = MatchingSection{
22512251 .seg = self.data_segment_cmd_index.?,
......@@ -4609,7 +4609,7 @@ fn populateLazyBindOffsetsInStubHelper(self: *MachO, buffer: []const u8) !void {
46094609
46104610 // Because we insert lazy binding opcodes in reverse order (from last to the first atom),
46114611 // we need reverse the order of atom traversal here as well.
4612 // TODO figure out a less error prone mechanims for this!
4612 // TODO figure out a less error prone mechanisms for this!
46134613 var atom = last_atom;
46144614 while (atom.prev) |prev| {
46154615 atom = prev;
src/link/MachO/Atom.zig+1-1
......@@ -41,7 +41,7 @@ code: std.ArrayListUnmanaged(u8) = .{},
4141size: u64,
4242
4343/// Alignment of this atom as a power of 2.
44/// For instance, aligmment of 0 should be read as 2^0 = 1 byte aligned.
44/// For instance, alignment of 0 should be read as 2^0 = 1 byte aligned.
4545alignment: u32,
4646
4747/// List of relocations belonging to this atom.
src/link/MachO/Trie.zig+1-1
......@@ -506,7 +506,7 @@ test "write Trie to a byte stream" {
506506 });
507507
508508 try trie.finalize(gpa);
509 try trie.finalize(gpa); // Finalizing mulitple times is a nop subsequently unless we add new nodes.
509 try trie.finalize(gpa); // Finalizing multiple times is a nop subsequently unless we add new nodes.
510510
511511 const exp_buffer = [_]u8{
512512 0x0, 0x1, // node root
src/link/Plan9/aout.zig+1-1
......@@ -16,7 +16,7 @@ pub const ExecHdr = extern struct {
1616 comptime {
1717 assert(@sizeOf(@This()) == 32);
1818 }
19 /// It is up to the caller to disgard the last 8 bytes if the header is not fat.
19 /// It is up to the caller to discard the last 8 bytes if the header is not fat.
2020 pub fn toU8s(self: *@This()) [40]u8 {
2121 var buf: [40]u8 = undefined;
2222 var i: u8 = 0;
src/link/SpirV.zig+2-2
......@@ -12,7 +12,7 @@
1212//! - OpName and OpMemberName instructions.
1313//! - OpModuleProcessed instructions.
1414//! All annotation (decoration) instructions.
15//! All type declaration instructions, constant instructions, global variable declarations, (preferrably) OpUndef instructions.
15//! All type declaration instructions, constant instructions, global variable declarations, (preferably) OpUndef instructions.
1616//! All function declarations without a body (extern functions presumably).
1717//! All regular functions.
1818
......@@ -93,7 +93,7 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio
9393 if (options.use_llvm) return error.LLVM_BackendIsTODO_ForSpirV; // TODO: LLVM Doesn't support SpirV at all.
9494 if (options.use_lld) return error.LLD_LinkingIsTODO_ForSpirV; // TODO: LLD Doesn't support SpirV at all.
9595
96 // TODO: read the file and keep vaild parts instead of truncating
96 // TODO: read the file and keep valid parts instead of truncating
9797 const file = try options.emit.?.directory.handle.createFile(sub_path, .{ .truncate = true, .read = true });
9898 errdefer file.close();
9999
src/link/Wasm.zig+3-3
......@@ -35,7 +35,7 @@ llvm_object: ?*LlvmObject = null,
3535/// TODO: can/should we access some data structure in Module directly?
3636funcs: std.ArrayListUnmanaged(*Module.Decl) = .{},
3737/// List of all extern function Decls to be written to the `import` section of the
38/// wasm binary. The positin in the list defines the function index
38/// wasm binary. The position in the list defines the function index
3939ext_funcs: std.ArrayListUnmanaged(*Module.Decl) = .{},
4040/// When importing objects from the host environment, a name must be supplied.
4141/// LLVM uses "env" by default when none is given. This would be a good default for Zig
......@@ -714,7 +714,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
714714 const full_out_path = try directory.join(arena, &[_][]const u8{self.base.options.emit.?.sub_path});
715715
716716 if (self.base.options.output_mode == .Obj) {
717 // LLD's WASM driver does not support the equvialent of `-r` so we do a simple file copy
717 // LLD's WASM driver does not support the equivalent of `-r` so we do a simple file copy
718718 // here. TODO: think carefully about how we can avoid this redundant operation when doing
719719 // build-obj. See also the corresponding TODO in linkAsArchive.
720720 const the_object_path = blk: {
......@@ -756,7 +756,7 @@ fn linkWithLLD(self: *Wasm, comp: *Compilation) !void {
756756
757757 if (self.base.options.output_mode == .Exe) {
758758 // Increase the default stack size to a more reasonable value of 1MB instead of
759 // the default of 1 Wasm page being 64KB, unless overriden by the user.
759 // the default of 1 Wasm page being 64KB, unless overridden by the user.
760760 try argv.append("-z");
761761 const stack_size = self.base.options.stack_size_override orelse 1048576;
762762 const arg = try std.fmt.allocPrint(arena, "stack-size={d}", .{stack_size});
src/stage1/analyze.cpp+1-1
......@@ -6804,7 +6804,7 @@ static Error resolve_async_frame(CodeGen *g, ZigType *frame_type) {
68046804 // Since this frame is async, an await might represent a suspend point, and
68056805 // therefore need to spill. It also needs to mark expr scopes as having to spill.
68066806 // For example: foo() + await z
6807 // The funtion call result of foo() must be spilled.
6807 // The function call result of foo() must be spilled.
68086808 for (size_t i = 0; i < fn->await_list.length; i += 1) {
68096809 Stage1AirInstAwait *await = fn->await_list.at(i);
68106810 if (await->is_nosuspend) {
src/stage1/ir.cpp+3-3
......@@ -6374,7 +6374,7 @@ static Stage1AirInst *ir_analyze_enum_to_union(IrAnalyze *ira, Scope *scope, Ast
63746374
63756375 if (target->value->type->data.enumeration.non_exhaustive) {
63766376 ir_add_error_node(ira, source_node,
6377 buf_sprintf("runtime cast to union '%s' from non-exhustive enum",
6377 buf_sprintf("runtime cast to union '%s' from non-exhaustive enum",
63786378 buf_ptr(&wanted_type->name)));
63796379 return ira->codegen->invalid_inst_gen;
63806380 }
......@@ -15189,7 +15189,7 @@ static Stage1AirInst *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_
1518915189 return ir_analyze_inferred_field_ptr(ira, field_name, scope, source_node, container_ptr, bare_type);
1519015190 }
1519115191
15192 // Tracks wether we should return an undefined value of the correct type.
15192 // Tracks whether we should return an undefined value of the correct type.
1519315193 // We do this if the container pointer is undefined and we are in a TypeOf call.
1519415194 bool return_undef = container_ptr->value->special == ConstValSpecialUndef && \
1519515195 get_scope_typeof(scope) != nullptr;
......@@ -15248,7 +15248,7 @@ static Stage1AirInst *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_
1524815248 if (type_is_invalid(union_val->type))
1524915249 return ira->codegen->invalid_inst_gen;
1525015250
15251 // Reject undefined values unless we're intializing the union:
15251 // Reject undefined values unless we're initializing the union:
1525215252 // a undefined union means also the tag is undefined, accessing
1525315253 // its payload slot is UB.
1525415254 const UndefAllowed allow_undef = initializing ? UndefOk : UndefBad;
src/stage1/ir_print.cpp+2-2
......@@ -558,7 +558,7 @@ const char* ir_inst_gen_type_str(Stage1AirInstId id) {
558558 case Stage1AirInstIdWasmMemoryGrow:
559559 return "GenWasmMemoryGrow";
560560 case Stage1AirInstIdExtern:
561 return "GenExtrern";
561 return "GenExtern";
562562 }
563563 zig_unreachable();
564564}
......@@ -829,7 +829,7 @@ static const char *cast_op_str(CastOp op) {
829829 case CastOpIntToFloat: return "IntToFloat";
830830 case CastOpFloatToInt: return "FloatToInt";
831831 case CastOpBoolToInt: return "BoolToInt";
832 case CastOpNumLitToConcrete: return "NumLitToConcrate";
832 case CastOpNumLitToConcrete: return "NumLitToConcrete";
833833 case CastOpErrSet: return "ErrSet";
834834 case CastOpBitCast: return "BitCast";
835835 }
src/stage1/parser.cpp+1-1
......@@ -2073,7 +2073,7 @@ static AstNode *ast_parse_field_init(ParseContext *pc) {
20732073 return nullptr;
20742074 }
20752075 if (eat_token_if(pc, TokenIdEq) == 0) {
2076 // Because ".Name" can also be intepreted as an enum literal, we should put back
2076 // Because ".Name" can also be interpreted as an enum literal, we should put back
20772077 // those two tokens again so that the parser can try to parse them as the enum
20782078 // literal later.
20792079 put_back_token(pc);
src/type.zig+1-1
......@@ -3419,7 +3419,7 @@ pub const Type = extern union {
34193419 anyerror_void_error_union,
34203420 generic_poison,
34213421 /// This is a special type for variadic parameters of a function call.
3422 /// Casts to it will validate that the type can be passed to a c calling convetion function.
3422 /// Casts to it will validate that the type can be passed to a c calling convention function.
34233423 var_args_param,
34243424 /// Same as `empty_struct` except it has an empty namespace.
34253425 empty_struct_literal,
src/windows_com.hpp+1-1
......@@ -352,7 +352,7 @@ extern "C" {
352352 /// <summary>
353353 /// Gets product-specific properties.
354354 /// </summary>
355 /// <param name="ppPropeties">A pointer to an instance of <see cref="ISetupPropertyStore"/>. This may be NULL if no properties are defined.</param>
355 /// <param name="ppProperties">A pointer to an instance of <see cref="ISetupPropertyStore"/>. This may be NULL if no properties are defined.</param>
356356 /// <returns>Standard HRESULT indicating success or failure, including E_FILENOTFOUND if the instance state does not exist.</returns>
357357 STDMETHOD(GetProperties)(
358358 _Outptr_result_maybenull_ ISetupPropertyStore** ppProperties
src/zig_clang.cpp+4-4
......@@ -1537,10 +1537,10 @@ void ZigClang_detect_enum_ConstantExprKind(clang::Expr::ConstantExprKind x) {
15371537 break;
15381538 }
15391539}
1540static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, "");
1541static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, "");
1542static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, "");
1543static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ContantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, "");
1540static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_Normal == clang::Expr::ConstantExprKind::Normal, "");
1541static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_NonClassTemplateArgument == clang::Expr::ConstantExprKind::NonClassTemplateArgument, "");
1542static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ClassTemplateArgument == clang::Expr::ConstantExprKind::ClassTemplateArgument, "");
1543static_assert((clang::Expr::ConstantExprKind)ZigClangExpr_ConstantExprKind_ImmediateInvocation == clang::Expr::ConstantExprKind::ImmediateInvocation, "");
15441544
15451545
15461546static_assert(sizeof(ZigClangAPValue) == sizeof(clang::APValue), "");
src/zig_clang.h+4-4
......@@ -934,10 +934,10 @@ enum ZigClangPreprocessedEntity_EntityKind {
934934};
935935
936936enum ZigClangExpr_ConstantExprKind {
937 ZigClangExpr_ContantExprKind_Normal,
938 ZigClangExpr_ContantExprKind_NonClassTemplateArgument,
939 ZigClangExpr_ContantExprKind_ClassTemplateArgument,
940 ZigClangExpr_ContantExprKind_ImmediateInvocation,
937 ZigClangExpr_ConstantExprKind_Normal,
938 ZigClangExpr_ConstantExprKind_NonClassTemplateArgument,
939 ZigClangExpr_ConstantExprKind_ClassTemplateArgument,
940 ZigClangExpr_ConstantExprKind_ImmediateInvocation,
941941};
942942
943943enum ZigClangUnaryExprOrTypeTrait_Kind {
src/zig_llvm-ar.cpp+1-1
......@@ -492,7 +492,7 @@ static std::string ArchiveName;
492492static std::vector<std::unique_ptr<MemoryBuffer>> ArchiveBuffers;
493493static std::vector<std::unique_ptr<object::Archive>> Archives;
494494
495// This variable holds the list of member files to proecess, as given
495// This variable holds the list of member files to process, as given
496496// on the command line.
497497static std::vector<StringRef> Members;
498498
test/behavior/array_stage1.zig+1-1
......@@ -140,7 +140,7 @@ fn testArrayByValAtComptime(b: [2]u8) u8 {
140140 return b[0];
141141}
142142
143test "comptime evalutating function that takes array by value" {
143test "comptime evaluating function that takes array by value" {
144144 const arr = [_]u8{ 0, 1 };
145145 _ = comptime testArrayByValAtComptime(arr);
146146 _ = comptime testArrayByValAtComptime(arr);
test/behavior/bugs/1735.zig+1-1
......@@ -40,7 +40,7 @@ const a = struct {
4040 }
4141};
4242
43test "intialization" {
43test "initialization" {
4444 var t = a.init();
4545 try std.testing.expect(t.foo.len == 0);
4646}
test/behavior/eval_stage1.zig+1-1
......@@ -88,7 +88,7 @@ var st_init_str_foo = StInitStrFoo{
8888 .y = true,
8989};
9090
91test "statically initalized array literal" {
91test "statically initialized array literal" {
9292 const y: [4]u8 = st_init_arr_lit_x;
9393 try expect(y[3] == 4);
9494}
test/behavior/switch.zig+7-7
......@@ -65,18 +65,18 @@ fn nonConstSwitchOnEnum(fruit: Fruit) void {
6565}
6666
6767test "switch statement" {
68 try nonConstSwitch(SwitchStatmentFoo.C);
68 try nonConstSwitch(SwitchStatementFoo.C);
6969}
70fn nonConstSwitch(foo: SwitchStatmentFoo) !void {
70fn nonConstSwitch(foo: SwitchStatementFoo) !void {
7171 const val = switch (foo) {
72 SwitchStatmentFoo.A => @as(i32, 1),
73 SwitchStatmentFoo.B => 2,
74 SwitchStatmentFoo.C => 3,
75 SwitchStatmentFoo.D => 4,
72 SwitchStatementFoo.A => @as(i32, 1),
73 SwitchStatementFoo.B => 2,
74 SwitchStatementFoo.C => 3,
75 SwitchStatementFoo.D => 4,
7676 };
7777 try expect(val == 3);
7878}
79const SwitchStatmentFoo = enum {
79const SwitchStatementFoo = enum {
8080 A,
8181 B,
8282 C,
test/behavior/vector.zig+1-1
......@@ -116,7 +116,7 @@ test "array to vector" {
116116 _ = vec;
117117}
118118
119test "vector casts of sizes not divisable by 8" {
119test "vector casts of sizes not divisible by 8" {
120120 const S = struct {
121121 fn doTheTest() !void {
122122 {
test/compile_errors.zig+6-6
......@@ -683,7 +683,7 @@ pub fn addCases(ctx: *TestContext) !void {
683683 \\ _ = u;
684684 \\}
685685 , &[_][]const u8{
686 "tmp.zig:12:16: error: runtime cast to union 'U' from non-exhustive enum",
686 "tmp.zig:12:16: error: runtime cast to union 'U' from non-exhaustive enum",
687687 "tmp.zig:17:16: error: no tag by value 15",
688688 });
689689
......@@ -6145,9 +6145,9 @@ pub fn addCases(ctx: *TestContext) !void {
61456145 });
61466146
61476147 ctx.objErrStage1("endless loop in function evaluation",
6148 \\const seventh_fib_number = fibbonaci(7);
6149 \\fn fibbonaci(x: i32) i32 {
6150 \\ return fibbonaci(x - 1) + fibbonaci(x - 2);
6148 \\const seventh_fib_number = fibonacci(7);
6149 \\fn fibonacci(x: i32) i32 {
6150 \\ return fibonacci(x - 1) + fibonacci(x - 2);
61516151 \\}
61526152 \\
61536153 \\export fn entry() usize { return @sizeOf(@TypeOf(seventh_fib_number)); }
......@@ -6775,7 +6775,7 @@ pub fn addCases(ctx: *TestContext) !void {
67756775 "tmp.zig:2:5: error: expression value is ignored",
67766776 });
67776777
6778 ctx.objErrStage1("ignored defered statement value",
6778 ctx.objErrStage1("ignored deferred statement value",
67796779 \\export fn foo() void {
67806780 \\ defer {1;}
67816781 \\}
......@@ -6783,7 +6783,7 @@ pub fn addCases(ctx: *TestContext) !void {
67836783 "tmp.zig:2:12: error: expression value is ignored",
67846784 });
67856785
6786 ctx.objErrStage1("ignored defered function call",
6786 ctx.objErrStage1("ignored deferred function call",
67876787 \\export fn foo() void {
67886788 \\ defer bar();
67896789 \\}
test/run_translated_c.zig+2-2
......@@ -24,7 +24,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
2424 \\}
2525 , "DEG2RAD is: 0.017453" ++ nl);
2626
27 cases.add("use global scope for record/enum/typedef type transalation if needed",
27 cases.add("use global scope for record/enum/typedef type translation if needed",
2828 \\void bar(void);
2929 \\void baz(void);
3030 \\struct foo { int x; };
......@@ -394,7 +394,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void {
394394 \\}
395395 , "");
396396
397 cases.add("ensure array casts outisde +=",
397 cases.add("ensure array casts outside +=",
398398 \\#include <stdlib.h>
399399 \\static int hash_binary(int k)
400400 \\{
test/stage2/darwin.zig+1-1
......@@ -118,7 +118,7 @@ pub fn addCases(ctx: *TestContext) !void {
118118 {
119119 var case = ctx.exe("corner case - update existing, singular TextBlock", target);
120120
121 // This test case also covers an infrequent scenarion where the string table *may* be relocated
121 // This test case also covers an infrequent scenario where the string table *may* be relocated
122122 // into the position preceeding the symbol table which results in a dyld error.
123123 case.addCompareOutput(
124124 \\extern fn exit(usize) noreturn;
test/tests.zig+1-1
......@@ -455,7 +455,7 @@ pub fn addTranslateCTests(b: *build.Builder, test_filter: ?[]const u8) *build.St
455455 const cases = b.allocator.create(TranslateCContext) catch unreachable;
456456 cases.* = TranslateCContext{
457457 .b = b,
458 .step = b.step("test-translate-c", "Run the C transation tests"),
458 .step = b.step("test-translate-c", "Run the C translation tests"),
459459 .test_index = 0,
460460 .test_filter = test_filter,
461461 };
test/translate_c.zig+2-2
......@@ -3188,7 +3188,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
31883188 \\}
31893189 });
31903190
3191 cases.add("macro comparisions",
3191 cases.add("macro comparisons",
31923192 \\#define MIN(a, b) ((b) < (a) ? (b) : (a))
31933193 \\#define MAX(a, b) ((b) > (a) ? (b) : (a))
31943194 , &[_][]const u8{
......@@ -3443,7 +3443,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
34433443 });
34443444 }
34453445
3446 cases.add("unnamed fields have predictabile names",
3446 cases.add("unnamed fields have predictable names",
34473447 \\struct a {
34483448 \\ struct {};
34493449 \\};