| author | |
| committer | |
| log | 2c93c6e91b6ed5177cd45336899f73940d1fa600 |
| tree | a25555d98fa16f6656a026dbfcfc9f74023b08d0 |
| parent | 574eb23f2ba18da574f7b93a637fb286e3930f1e |
80 files changed, 160 insertions(+), 160 deletions(-)
build.zig+6-6| ... | ... | @@ -57,7 +57,7 @@ pub fn build(b: *std.Build) !void { |
| 57 | 57 | .root_module = b.createModule(.{ |
| 58 | 58 | .root_source_file = b.path("lib/std/std.zig"), |
| 59 | 59 | .target = target, |
| 60 | .optimize = .Debug, | |
| 60 | .optimize = .debug, | |
| 61 | 61 | }), |
| 62 | 62 | }); |
| 63 | 63 | const install_std_docs = b.addInstallDirectory(.{ |
| ... | ... | @@ -431,7 +431,7 @@ pub fn build(b: *std.Build) !void { |
| 431 | 431 | const test_target_filters = b.option([]const []const u8, "test-target-filter", "Skip tests whose target triple do not match any filter") orelse &[0][]const u8{}; |
| 432 | 432 | const test_extra_targets = b.option(bool, "test-extra-targets", "Enable running module tests for additional targets") orelse false; |
| 433 | 433 | |
| 434 | var chosen_opt_modes_buf: [4]std.lang.OptimizeMode = undefined; | |
| 434 | var chosen_opt_modes_buf: [4]std.lang.Optimize = undefined; | |
| 435 | 435 | var chosen_mode_index: usize = 0; |
| 436 | 436 | if (!skip_debug) { |
| 437 | 437 | chosen_opt_modes_buf[chosen_mode_index] = .debug; |
| ... | ... | @@ -788,7 +788,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { |
| 788 | 788 | const semver = try std.SemanticVersion.parse(version); |
| 789 | 789 | |
| 790 | 790 | const exe = addCompilerStep(b, .{ |
| 791 | .optimize = .ReleaseSmall, | |
| 791 | .optimize = .small, | |
| 792 | 792 | .target = b.resolveTargetQuery(std.Target.Query.parse(.{ |
| 793 | 793 | .arch_os_abi = "wasm32-wasi", |
| 794 | 794 | // * `nontrapping_bulk_memory_len0` is supported by `wasm2c`. |
| ... | ... | @@ -853,7 +853,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void { |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | 855 | const AddCompilerModOptions = struct { |
| 856 | optimize: std.lang.OptimizeMode, | |
| 856 | optimize: std.lang.Optimize, | |
| 857 | 857 | target: std.Build.ResolvedTarget, |
| 858 | 858 | strip: ?bool = null, |
| 859 | 859 | valgrind: ?bool = null, |
| ... | ... | @@ -1606,7 +1606,7 @@ fn generateLangRef(b: *std.Build) !std.Build.LazyPath { |
| 1606 | 1606 | .root_module = b.createModule(.{ |
| 1607 | 1607 | .root_source_file = b.path("tools/doctest.zig"), |
| 1608 | 1608 | .target = b.graph.host, |
| 1609 | .optimize = .Debug, | |
| 1609 | .optimize = .debug, | |
| 1610 | 1610 | }), |
| 1611 | 1611 | }); |
| 1612 | 1612 | |
| ... | ... | @@ -1649,7 +1649,7 @@ fn generateLangRef(b: *std.Build) !std.Build.LazyPath { |
| 1649 | 1649 | .root_module = b.createModule(.{ |
| 1650 | 1650 | .root_source_file = b.path("tools/docgen.zig"), |
| 1651 | 1651 | .target = b.graph.host, |
| 1652 | .optimize = .Debug, | |
| 1652 | .optimize = .debug, | |
| 1653 | 1653 | }), |
| 1654 | 1654 | }); |
| 1655 | 1655 |
lib/compiler/Maker.zig+2-2| ... | ... | @@ -440,9 +440,9 @@ pub fn main(init: process.Init.Minimal) !void { |
| 440 | 440 | } else if (mem.eql(u8, arg, "--debug-pkg-config")) { |
| 441 | 441 | debug_pkg_config = true; |
| 442 | 442 | } else if (mem.eql(u8, arg, "--debug-rt")) { |
| 443 | graph.debug_compiler_runtime_libs = .Debug; | |
| 443 | graph.debug_compiler_runtime_libs = .debug; | |
| 444 | 444 | } else if (mem.cutPrefix(u8, arg, "--debug-rt=")) |rest| { |
| 445 | graph.debug_compiler_runtime_libs = stringToEnum(std.lang.OptimizeMode, rest) orelse | |
| 445 | graph.debug_compiler_runtime_libs = stringToEnum(std.lang.Optimize, rest) orelse | |
| 446 | 446 | fatal("unrecognized optimization mode: {s}", .{rest}); |
| 447 | 447 | } else if (is_debug_mode and mem.eql(u8, arg, "--debug-maker-leaks")) { |
| 448 | 448 | debug_maker_leaks = true; |
lib/compiler/Maker/Graph.zig+1-1| ... | ... | @@ -18,7 +18,7 @@ local_cache_root: Directory, |
| 18 | 18 | zig_lib_directory: Directory, |
| 19 | 19 | build_root_directory: Directory, |
| 20 | 20 | |
| 21 | debug_compiler_runtime_libs: ?std.builtin.OptimizeMode = null, | |
| 21 | debug_compiler_runtime_libs: ?std.builtin.Optimize = null, | |
| 22 | 22 | incremental: ?bool = null, |
| 23 | 23 | random_seed: u32 = 0, |
| 24 | 24 | allow_so_scripts: ?bool = null, |
lib/compiler/Maker/Step/Compile.zig+5-5| ... | ... | @@ -666,7 +666,7 @@ fn lowerZigArgs( |
| 666 | 666 | |
| 667 | 667 | try zig_args.ensureUnusedCapacity(gpa, 1); |
| 668 | 668 | if (graph.debug_compiler_runtime_libs) |mode| switch (mode) { |
| 669 | .Debug => zig_args.appendAssumeCapacity("--debug-rt"), | |
| 669 | .debug => zig_args.appendAssumeCapacity("--debug-rt"), | |
| 670 | 670 | else => zig_args.appendAssumeCapacity(try arena.print("--debug-rt={t}", .{mode})), |
| 671 | 671 | }; |
| 672 | 672 | |
| ... | ... | @@ -1266,10 +1266,10 @@ fn appendModuleFlags( |
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | switch (m.flags.optimize) { |
| 1269 | .debug => zig_args.appendAssumeCapacity("-ODebug"), | |
| 1270 | .safe => zig_args.appendAssumeCapacity("-OReleaseSafe"), | |
| 1271 | .fast => zig_args.appendAssumeCapacity("-OReleaseFast"), | |
| 1272 | .small => zig_args.appendAssumeCapacity("-OReleaseSmall"), | |
| 1269 | .debug => zig_args.appendAssumeCapacity("-Odebug"), | |
| 1270 | .safe => zig_args.appendAssumeCapacity("-Osafe"), | |
| 1271 | .fast => zig_args.appendAssumeCapacity("-Ofast"), | |
| 1272 | .small => zig_args.appendAssumeCapacity("-Osmall"), | |
| 1273 | 1273 | .default => {}, |
| 1274 | 1274 | } |
| 1275 | 1275 |
lib/compiler/Maker/Step/TranslateC.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ const std = @import("std"); |
| 4 | 4 | const Io = std.Io; |
| 5 | 5 | const Configuration = std.Build.Configuration; |
| 6 | 6 | const assert = std.debug.assert; |
| 7 | const OptimizeMode = std.lang.OptimizeMode; | |
| 7 | const OptimizeMode = std.lang.Optimize; | |
| 8 | 8 | |
| 9 | 9 | const Step = @import("../Step.zig"); |
| 10 | 10 | const Maker = @import("../../Maker.zig"); |
lib/compiler/Maker/WebServer.zig+2-2| ... | ... | @@ -531,7 +531,7 @@ fn serveLibFile( |
| 531 | 531 | fn serveClientWasm( |
| 532 | 532 | ws: *WebServer, |
| 533 | 533 | req: *http.Server.Request, |
| 534 | optimize_mode: std.builtin.OptimizeMode, | |
| 534 | optimize_mode: std.builtin.Optimize, | |
| 535 | 535 | ) !void { |
| 536 | 536 | const gpa = ws.graph.cache.gpa; |
| 537 | 537 | |
| ... | ... | @@ -603,7 +603,7 @@ pub fn serveTarFile(ws: *WebServer, request: *http.Server.Request, paths: []cons |
| 603 | 603 | try response.end(); |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.OptimizeMode) !Cache.Path { | |
| 606 | fn buildClientWasm(ws: *WebServer, arena: Allocator, optimize: std.builtin.Optimize) !Cache.Path { | |
| 607 | 607 | const root_name = "build-web"; |
| 608 | 608 | const arch_os_abi = "wasm32-freestanding"; |
| 609 | 609 | const cpu_features = "baseline+atomics+bulk_memory+multivalue+mutable_globals+nontrapping_fptoint+reference_types+sign_ext"; |
lib/compiler/std-docs.zig+2-2| ... | ... | @@ -259,7 +259,7 @@ fn serveSourcesTar(request: *std.http.Server.Request, context: *Context) !void { |
| 259 | 259 | fn serveWasm( |
| 260 | 260 | request: *std.http.Server.Request, |
| 261 | 261 | context: *Context, |
| 262 | optimize_mode: std.builtin.OptimizeMode, | |
| 262 | optimize_mode: std.builtin.Optimize, | |
| 263 | 263 | ) !void { |
| 264 | 264 | const gpa = context.gpa; |
| 265 | 265 | const io = context.io; |
| ... | ... | @@ -302,7 +302,7 @@ const autodoc_cpu_features = "baseline+atomics+bulk_memory+multivalue+mutable_gl |
| 302 | 302 | fn buildWasmBinary( |
| 303 | 303 | arena: Allocator, |
| 304 | 304 | context: *Context, |
| 305 | optimize_mode: std.builtin.OptimizeMode, | |
| 305 | optimize_mode: std.builtin.Optimize, | |
| 306 | 306 | ) !Cache.Path { |
| 307 | 307 | const gpa = context.gpa; |
| 308 | 308 | const io = context.io; |
lib/std/Build.zig+5-5| ... | ... | @@ -691,7 +691,7 @@ pub const AssemblyOptions = struct { |
| 691 | 691 | /// To choose the same computer as the one building the package, pass the |
| 692 | 692 | /// `host` field of the package's `Build` instance. |
| 693 | 693 | target: ResolvedTarget, |
| 694 | optimize: std.builtin.OptimizeMode, | |
| 694 | optimize: std.builtin.Optimize, | |
| 695 | 695 | max_rss: u64 = 0, |
| 696 | 696 | zig_lib_dir: ?LazyPath = null, |
| 697 | 697 | }; |
| ... | ... | @@ -1188,22 +1188,22 @@ pub fn step(b: *Build, name: []const u8, description: []const u8) *Step { |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | pub const StandardOptimizeOptionOptions = struct { |
| 1191 | preferred_optimize_mode: ?std.builtin.OptimizeMode = null, | |
| 1191 | preferred_optimize_mode: ?std.builtin.Optimize = null, | |
| 1192 | 1192 | }; |
| 1193 | 1193 | |
| 1194 | pub fn standardOptimizeOption(b: *Build, options: StandardOptimizeOptionOptions) std.builtin.OptimizeMode { | |
| 1194 | pub fn standardOptimizeOption(b: *Build, options: StandardOptimizeOptionOptions) std.builtin.Optimize { | |
| 1195 | 1195 | const graph = b.graph; |
| 1196 | 1196 | |
| 1197 | 1197 | if (options.preferred_optimize_mode) |mode| { |
| 1198 | 1198 | if (b.option(bool, "release", "optimize for end users") orelse (graph.release_mode != .off)) { |
| 1199 | 1199 | return mode; |
| 1200 | 1200 | } else { |
| 1201 | return .Debug; | |
| 1201 | return .debug; | |
| 1202 | 1202 | } |
| 1203 | 1203 | } |
| 1204 | 1204 | |
| 1205 | 1205 | if (b.option( |
| 1206 | std.builtin.OptimizeMode, | |
| 1206 | std.builtin.Optimize, | |
| 1207 | 1207 | "optimize", |
| 1208 | 1208 | "Prioritize performance, safety, or binary size", |
| 1209 | 1209 | )) |mode| { |
lib/std/Build/Configuration.zig+1-1| ... | ... | @@ -1660,7 +1660,7 @@ pub const Module = struct { |
| 1660 | 1660 | small, |
| 1661 | 1661 | default, |
| 1662 | 1662 | |
| 1663 | pub fn init(o: ?std.builtin.OptimizeMode) Optimize { | |
| 1663 | pub fn init(o: ?std.builtin.Optimize) Optimize { | |
| 1664 | 1664 | return switch (o orelse return .default) { |
| 1665 | 1665 | .debug => .debug, |
| 1666 | 1666 | .safe => .safe, |
lib/std/Build/Module.zig+2-2| ... | ... | @@ -15,7 +15,7 @@ root_source_file: ?LazyPath, |
| 15 | 15 | import_table: std.array_hash_map.String(*Module), |
| 16 | 16 | |
| 17 | 17 | resolved_target: ?std.Build.ResolvedTarget = null, |
| 18 | optimize: ?std.builtin.OptimizeMode = null, | |
| 18 | optimize: ?std.builtin.Optimize = null, | |
| 19 | 19 | dwarf_format: ?std.dwarf.Format, |
| 20 | 20 | |
| 21 | 21 | c_macros: ArrayList([]const u8), |
| ... | ... | @@ -200,7 +200,7 @@ pub const CreateOptions = struct { |
| 200 | 200 | imports: []const Import = &.{}, |
| 201 | 201 | |
| 202 | 202 | target: ?std.Build.ResolvedTarget = null, |
| 203 | optimize: ?std.builtin.OptimizeMode = null, | |
| 203 | optimize: ?std.builtin.Optimize = null, | |
| 204 | 204 | |
| 205 | 205 | /// `true` requires a compilation that includes this Module to link libc. |
| 206 | 206 | /// `false` causes a build failure if a compilation that includes this Module would link libc. |
lib/std/Build/Step/TranslateC.zig+3-3| ... | ... | @@ -13,7 +13,7 @@ include_dirs: std.ArrayList(std.Build.Module.IncludeDir) = .empty, |
| 13 | 13 | system_libs: std.ArrayList(std.Build.Module.SystemLib) = .empty, |
| 14 | 14 | c_macros: std.ArrayList(Configuration.String) = .empty, |
| 15 | 15 | target: std.Build.ResolvedTarget, |
| 16 | optimize: std.builtin.OptimizeMode, | |
| 16 | optimize: std.builtin.Optimize, | |
| 17 | 17 | output_file: Configuration.GeneratedFileIndex, |
| 18 | 18 | link_libc: bool, |
| 19 | 19 | |
| ... | ... | @@ -22,7 +22,7 @@ pub const base_tag: Step.Tag = .translate_c; |
| 22 | 22 | pub const Options = struct { |
| 23 | 23 | root_source_file: std.Build.LazyPath, |
| 24 | 24 | target: std.Build.ResolvedTarget, |
| 25 | optimize: std.builtin.OptimizeMode, | |
| 25 | optimize: std.builtin.Optimize, | |
| 26 | 26 | link_libc: bool = true, |
| 27 | 27 | }; |
| 28 | 28 | |
| ... | ... | @@ -50,7 +50,7 @@ pub const AddExecutableOptions = struct { |
| 50 | 50 | name: ?[]const u8 = null, |
| 51 | 51 | version: ?std.SemanticVersion = null, |
| 52 | 52 | target: ?std.Build.ResolvedTarget = null, |
| 53 | optimize: ?std.builtin.OptimizeMode = null, | |
| 53 | optimize: ?std.builtin.Optimize = null, | |
| 54 | 54 | linkage: ?std.builtin.LinkMode = null, |
| 55 | 55 | }; |
| 56 | 56 |
lib/std/Io/Threaded.zig+2-2| ... | ... | @@ -16972,7 +16972,7 @@ test argvToCommandLineWindows { |
| 16972 | 16972 | , |
| 16973 | 16973 | \\-O |
| 16974 | 16974 | , |
| 16975 | \\ReleaseSafe | |
| 16975 | \\safe | |
| 16976 | 16976 | , |
| 16977 | 16977 | \\-- |
| 16978 | 16978 | , |
| ... | ... | @@ -16981,7 +16981,7 @@ test argvToCommandLineWindows { |
| 16981 | 16981 | \\--eval=new Regex("Dwayne \"The Rock\" Johnson") |
| 16982 | 16982 | , |
| 16983 | 16983 | }, |
| 16984 | \\"C:\Program Files\zig\zig.exe" run .\src\main.zig -target x86_64-windows-gnu -O ReleaseSafe -- --emoji=🗿 "--eval=new Regex(\"Dwayne \\\"The Rock\\\" Johnson\")" | |
| 16984 | \\"C:\Program Files\zig\zig.exe" run .\src\main.zig -target x86_64-windows-gnu -O safe -- --emoji=🗿 "--eval=new Regex(\"Dwayne \\\"The Rock\\\" Johnson\")" | |
| 16985 | 16985 | ); |
| 16986 | 16986 | |
| 16987 | 16987 | try t(&.{}, ""); |
lib/std/heap/debug_allocator.zig+1-1| ... | ... | @@ -105,7 +105,7 @@ const Log2USize = std.math.Log2Int(usize); |
| 105 | 105 | |
| 106 | 106 | const default_sys_stack_trace_frames: usize = if (std.debug.sys_can_stack_trace) 6 else 0; |
| 107 | 107 | const default_stack_trace_frames: usize = switch (builtin.mode) { |
| 108 | .Debug => default_sys_stack_trace_frames, | |
| 108 | .debug => default_sys_stack_trace_frames, | |
| 109 | 109 | else => 0, |
| 110 | 110 | }; |
| 111 | 111 |
lib/std/log.zig+1-1| ... | ... | @@ -52,7 +52,7 @@ pub const Level = enum { |
| 52 | 52 | |
| 53 | 53 | /// The default log level is based on build mode. |
| 54 | 54 | pub const default_level: Level = switch (builtin.mode) { |
| 55 | .Debug => .debug, | |
| 55 | .debug => .debug, | |
| 56 | 56 | .safe, .fast, .small => .info, |
| 57 | 57 | }; |
| 58 | 58 |
lib/std/os/windows.zig+2-2| ... | ... | @@ -3955,7 +3955,7 @@ pub fn unexpectedStatus(status: NTSTATUS) UnexpectedError { |
| 3955 | 3955 | |
| 3956 | 3956 | pub fn statusBug(status: NTSTATUS) UnexpectedError { |
| 3957 | 3957 | switch (builtin.mode) { |
| 3958 | .Debug => std.debug.panic("programmer bug caused syscall status: 0x{x} ({s})", .{ | |
| 3958 | .debug => std.debug.panic("programmer bug caused syscall status: 0x{x} ({s})", .{ | |
| 3959 | 3959 | @backingInt(status), |
| 3960 | 3960 | std.enums.tagName(NTSTATUS, status) orelse "<unnamed>", |
| 3961 | 3961 | }), |
| ... | ... | @@ -3965,7 +3965,7 @@ pub fn statusBug(status: NTSTATUS) UnexpectedError { |
| 3965 | 3965 | |
| 3966 | 3966 | pub fn errorBug(err: Win32Error) UnexpectedError { |
| 3967 | 3967 | switch (builtin.mode) { |
| 3968 | .Debug => std.debug.panic("programmer bug caused syscall error: 0x{x} ({s})", .{ | |
| 3968 | .debug => std.debug.panic("programmer bug caused syscall error: 0x{x} ({s})", .{ | |
| 3969 | 3969 | @backingInt(err), |
| 3970 | 3970 | std.enums.tagName(Win32Error, err) orelse "<unnamed>", |
| 3971 | 3971 | }), |
lib/std/process/Args.zig+2-2| ... | ... | @@ -537,7 +537,7 @@ test "Iterator.Windows" { |
| 537 | 537 | const t = testIteratorWindows; |
| 538 | 538 | |
| 539 | 539 | try t( |
| 540 | \\"C:\Program Files\zig\zig.exe" run .\src\main.zig -target x86_64-windows-gnu -O ReleaseSafe -- --emoji=🗿 --eval="new Regex(\"Dwayne \\\"The Rock\\\" Johnson\")" | |
| 540 | \\"C:\Program Files\zig\zig.exe" run .\src\main.zig -target x86_64-windows-gnu -O safe -- --emoji=🗿 --eval="new Regex(\"Dwayne \\\"The Rock\\\" Johnson\")" | |
| 541 | 541 | , &.{ |
| 542 | 542 | \\C:\Program Files\zig\zig.exe |
| 543 | 543 | , |
| ... | ... | @@ -551,7 +551,7 @@ test "Iterator.Windows" { |
| 551 | 551 | , |
| 552 | 552 | \\-O |
| 553 | 553 | , |
| 554 | \\ReleaseSafe | |
| 554 | \\safe | |
| 555 | 555 | , |
| 556 | 556 | \\-- |
| 557 | 557 | , |
src/codegen/riscv64/CodeGen.zig+1-1| ... | ... | @@ -8341,7 +8341,7 @@ fn resolveCallingConventionValues( |
| 8341 | 8341 | |
| 8342 | 8342 | fn wantSafety(func: *Func) bool { |
| 8343 | 8343 | return switch (func.mod.optimize_mode) { |
| 8344 | .Debug => true, | |
| 8344 | .debug => true, | |
| 8345 | 8345 | .safe => true, |
| 8346 | 8346 | .fast => false, |
| 8347 | 8347 | .small => false, |
src/codegen/sparc64/CodeGen.zig+1-1| ... | ... | @@ -4766,7 +4766,7 @@ fn truncRegister( |
| 4766 | 4766 | /// TODO support scope overrides. Also note this logic is duplicated with `Zcu.wantSafety`. |
| 4767 | 4767 | fn wantSafety(self: *Self) bool { |
| 4768 | 4768 | return switch (self.bin_file.comp.root_mod.optimize_mode) { |
| 4769 | .Debug => true, | |
| 4769 | .debug => true, | |
| 4770 | 4770 | .safe => true, |
| 4771 | 4771 | .fast => false, |
| 4772 | 4772 | .small => false, |
src/main.zig+1-1| ... | ... | @@ -805,7 +805,7 @@ const compile_usage = |
| 805 | 805 | \\ --debug-compile-errors Crash with helpful diagnostics at the first compile error |
| 806 | 806 | \\ --debug-link-snapshot Enable dumping of the linker's state in JSON format |
| 807 | 807 | \\ --debug-rt[=mode] Build compiler runtime libraries with [mode] optimization |
| 808 | \\ (Debug if [=mode] is omitted) | |
| 808 | \\ (debug if [=mode] is omitted) | |
| 809 | 809 | \\ --debug-incremental Enable incremental compilation debug features |
| 810 | 810 | \\ |
| 811 | 811 | ; |
test/cases/compile_errors/invalid_member_of_builtin_enum.zig+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | const lang = @import("std").lang; |
| 2 | 2 | export fn entry() void { |
| 3 | const foo = lang.OptimizeMode.x86; | |
| 3 | const foo = lang.Optimize.x86; | |
| 4 | 4 | _ = foo; |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | 7 | // error |
| 8 | 8 | // |
| 9 | // :3:35: error: enum 'lang.Optimize' has no member named 'x86' | |
| 9 | // :3:31: error: enum 'lang.Optimize' has no member named 'x86' | |
| 10 | 10 | // : note: enum declared here |
test/cli/options/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const main = b.addTest(.{ .root_module = b.createModule(.{ |
| 5 | 5 | .root_source_file = b.path("src/main.zig"), |
| 6 | 6 | .target = b.graph.host, |
| 7 | .optimize = .Debug, | |
| 7 | .optimize = .debug, | |
| 8 | 8 | }) }); |
| 9 | 9 | |
| 10 | 10 | const options = b.addOptions(); |
test/src/Cases.zig+1-1| ... | ... | @@ -49,7 +49,7 @@ pub const Case = struct { |
| 49 | 49 | /// In order to be able to run e.g. Execution updates, this must be set |
| 50 | 50 | /// to Executable. |
| 51 | 51 | output_mode: std.builtin.OutputMode, |
| 52 | optimize_mode: std.builtin.OptimizeMode = .Debug, | |
| 52 | optimize_mode: std.builtin.Optimize = .debug, | |
| 53 | 53 | |
| 54 | 54 | files: std.array_list.Managed(File), |
| 55 | 55 | case: ?union(enum) { |
test/src/Debugger.zig+2-2| ... | ... | @@ -7,14 +7,14 @@ pub const Options = struct { |
| 7 | 7 | test_target_filters: []const []const u8, |
| 8 | 8 | gdb: ?[]const u8, |
| 9 | 9 | lldb: ?[]const u8, |
| 10 | optimize_modes: []const std.builtin.OptimizeMode, | |
| 10 | optimize_modes: []const std.builtin.Optimize, | |
| 11 | 11 | skip_single_threaded: bool, |
| 12 | 12 | skip_libc: bool, |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | 15 | pub const Target = struct { |
| 16 | 16 | resolved: std.Build.ResolvedTarget, |
| 17 | optimize_mode: std.builtin.OptimizeMode = .Debug, | |
| 17 | optimize_mode: std.builtin.Optimize = .debug, | |
| 18 | 18 | link_libc: ?bool = null, |
| 19 | 19 | single_threaded: ?bool = null, |
| 20 | 20 | pic: ?bool = null, |
test/src/ErrorTrace.zig+1-1| ... | ... | @@ -33,7 +33,7 @@ pub const Options = struct { |
| 33 | 33 | |
| 34 | 34 | pub const CaseParameters = struct { |
| 35 | 35 | target: std.Target.Query = .{}, |
| 36 | optimize: std.builtin.OptimizeMode = .debug, | |
| 36 | optimize: OptimizeMode = .debug, | |
| 37 | 37 | use_llvm: ?bool = null, |
| 38 | 38 | use_lld: ?bool = null, |
| 39 | 39 |
test/src/Libc.zig+1-1| ... | ... | @@ -7,7 +7,7 @@ libc_test_src_path: std.Build.LazyPath, |
| 7 | 7 | test_cases: std.ArrayList(TestCase) = .empty, |
| 8 | 8 | |
| 9 | 9 | pub const Options = struct { |
| 10 | optimize_modes: []const std.builtin.OptimizeMode, | |
| 10 | optimize_modes: []const std.builtin.Optimize, | |
| 11 | 11 | test_filters: []const []const u8, |
| 12 | 12 | test_target_filters: []const []const u8, |
| 13 | 13 | skip_wasm: bool, |
test/src/Link.zig+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | b: *Build, |
| 2 | 2 | step: *Step, |
| 3 | optimize: std.builtin.OptimizeMode, | |
| 3 | optimize: std.builtin.Optimize, | |
| 4 | 4 | target: std.Build.ResolvedTarget, |
| 5 | 5 | target_desc: []const u8, |
| 6 | 6 | use_llvm: bool, |
test/src/LlvmIr.zig+1-1| ... | ... | @@ -27,7 +27,7 @@ const TestCase = struct { |
| 27 | 27 | // For most cases, we want to test the LLVM IR that we output; we don't want to be in the |
| 28 | 28 | // business of testing LLVM's optimization passes. `Debug` gets us the closest to that as it |
| 29 | 29 | // disables the vast majority of passes in LLVM. |
| 30 | optimize: std.builtin.OptimizeMode = .Debug, | |
| 30 | optimize: std.builtin.Optimize = .debug, | |
| 31 | 31 | pic: ?bool = null, |
| 32 | 32 | pie: ?bool = null, |
| 33 | 33 | red_zone: ?bool = null, |
test/src/StackTrace.zig+1-1| ... | ... | @@ -34,7 +34,7 @@ pub const Options = struct { |
| 34 | 34 | pub const CaseParameters = struct { |
| 35 | 35 | linkage: ?std.builtin.LinkMode = null, |
| 36 | 36 | target: std.Target.Query = .{}, |
| 37 | optimize: std.builtin.OptimizeMode = .debug, | |
| 37 | optimize: std.lang.Optimize = .debug, | |
| 38 | 38 | link_libc: ?bool = null, |
| 39 | 39 | use_llvm: ?bool = null, |
| 40 | 40 | use_lld: ?bool = null, |
test/standalone/c_compiler/build.zig+5-5| ... | ... | @@ -5,10 +5,10 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | add(b, test_step, "test_c_Debug", "test_cpp_Debug", .Debug); | |
| 9 | add(b, test_step, "test_c_ReleaseFast", "test_cpp_ReleaseFast", .ReleaseFast); | |
| 10 | add(b, test_step, "test_c_ReleaseSmall", "test_cpp_ReleaseSmall", .ReleaseSmall); | |
| 11 | add(b, test_step, "test_c_ReleaseSafe", "test_cpp_ReleaseSafe", .ReleaseSafe); | |
| 8 | add(b, test_step, "test_c_debug", "test_cpp_debug", .debug); | |
| 9 | add(b, test_step, "test_c_fast", "test_cpp_fast", .fast); | |
| 10 | add(b, test_step, "test_c_small", "test_cpp_small", .small); | |
| 11 | add(b, test_step, "test_c_safe", "test_cpp_safe", .safe); | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | fn add( |
| ... | ... | @@ -16,7 +16,7 @@ fn add( |
| 16 | 16 | test_step: *std.Build.Step, |
| 17 | 17 | c_name: []const u8, |
| 18 | 18 | cpp_name: []const u8, |
| 19 | optimize: std.builtin.OptimizeMode, | |
| 19 | optimize: std.builtin.Optimize, | |
| 20 | 20 | ) void { |
| 21 | 21 | const target = b.graph.host; |
| 22 | 22 |
test/standalone/c_embed_path/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const exe = b.addExecutable(.{ |
| 10 | 10 | .name = "test", |
test/standalone/child_process/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag == .wasi) return; |
test/standalone/coff_dwarf/build.zig+1-1| ... | ... | @@ -18,7 +18,7 @@ pub fn build(b: *std.Build) void { |
| 18 | 18 | const test_step = b.step("test", "Test it"); |
| 19 | 19 | b.default_step = test_step; |
| 20 | 20 | |
| 21 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 21 | const optimize: std.builtin.Optimize = .debug; | |
| 22 | 22 | const target = switch (host.result.os.tag) { |
| 23 | 23 | .windows => host, |
| 24 | 24 | else => b.resolveTargetQuery(.{ .os_tag = .windows }), |
test/standalone/compile_asm/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) !void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.resolveTargetQuery(.{ |
| 9 | 9 | .os_tag = .freestanding, |
| 10 | 10 | .cpu_arch = .arm, |
test/standalone/dep_diamond/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main_mod = b.createModule(.{ |
| 10 | 10 | .root_source_file = b.path("test.zig"), |
test/standalone/dep_mutually_recursive/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main_mod = b.createModule(.{ |
| 10 | 10 | .root_source_file = b.path("test.zig"), |
test/standalone/dep_recursive/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main_mod = b.createModule(.{ |
| 10 | 10 | .root_source_file = b.path("test.zig"), |
test/standalone/dep_shared_builtin/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main_mod = b.createModule(.{ |
| 10 | 10 | .root_source_file = b.path("test.zig"), |
test/standalone/dep_triangle/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main_mod = b.createModule(.{ |
| 10 | 10 | .root_source_file = b.path("test.zig"), |
test/standalone/dependency_options/build.zig+3-3| ... | ... | @@ -10,7 +10,7 @@ pub fn build(b: *std.Build) !void { |
| 10 | 10 | |
| 11 | 11 | const none_specified_mod = none_specified.module("dummy"); |
| 12 | 12 | if (!none_specified_mod.resolved_target.?.query.eql(b.graph.host.query)) return error.TestFailed; |
| 13 | const expected_optimize: std.builtin.OptimizeMode = switch (b.graph.release_mode) { | |
| 13 | const expected_optimize: std.builtin.Optimize = switch (b.graph.release_mode) { | |
| 14 | 14 | .off => .debug, |
| 15 | 15 | .any => unreachable, |
| 16 | 16 | .fast => .fast, |
| ... | ... | @@ -44,7 +44,7 @@ pub fn build(b: *std.Build) !void { |
| 44 | 44 | |
| 45 | 45 | const all_specified = b.dependency("other", .{ |
| 46 | 46 | .target = b.resolveTargetQuery(.{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .gnu }), |
| 47 | .optimize = @as(std.builtin.OptimizeMode, .safe), | |
| 47 | .optimize = @as(std.builtin.Optimize, .safe), | |
| 48 | 48 | .bool = @as(bool, true), |
| 49 | 49 | .int = @as(i64, 123), |
| 50 | 50 | .float = @as(f64, 0.5), |
| ... | ... | @@ -70,7 +70,7 @@ pub fn build(b: *std.Build) !void { |
| 70 | 70 | |
| 71 | 71 | const all_specified_optional = b.dependency("other", .{ |
| 72 | 72 | .target = @as(?std.Build.ResolvedTarget, b.resolveTargetQuery(.{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .gnu })), |
| 73 | .optimize = @as(?std.builtin.OptimizeMode, .safe), | |
| 73 | .optimize = @as(?std.builtin.Optimize, .safe), | |
| 74 | 74 | .bool = @as(?bool, true), |
| 75 | 75 | .int = @as(?i64, 123), |
| 76 | 76 | .float = @as(?f64, 0.5), |
test/standalone/dirname/build.zig+2-2| ... | ... | @@ -12,7 +12,7 @@ pub fn build(b: *std.Build) void { |
| 12 | 12 | .name = "touch", |
| 13 | 13 | .root_module = b.createModule(.{ |
| 14 | 14 | .root_source_file = touch_src, |
| 15 | .optimize = .Debug, | |
| 15 | .optimize = .debug, | |
| 16 | 16 | .target = target, |
| 17 | 17 | }), |
| 18 | 18 | }); |
| ... | ... | @@ -22,7 +22,7 @@ pub fn build(b: *std.Build) void { |
| 22 | 22 | .name = "exists_in", |
| 23 | 23 | .root_module = b.createModule(.{ |
| 24 | 24 | .root_source_file = b.path("exists_in.zig"), |
| 25 | .optimize = .Debug, | |
| 25 | .optimize = .debug, | |
| 26 | 26 | .target = target, |
| 27 | 27 | }), |
| 28 | 28 | }); |
test/standalone/elf2/build.zig+1-1| ... | ... | @@ -32,7 +32,7 @@ fn addOne( |
| 32 | 32 | const mod = b.createModule(.{ |
| 33 | 33 | .root_source_file = b.path("hello.zig"), |
| 34 | 34 | .target = target, |
| 35 | .optimize = .Debug, | |
| 35 | .optimize = .debug, | |
| 36 | 36 | .link_libc = link_mode == .dynamic, |
| 37 | 37 | }); |
| 38 | 38 | const exe = b.addExecutable(.{ |
test/standalone/embed_generated_file/build.zig+2-2| ... | ... | @@ -12,14 +12,14 @@ pub fn build(b: *std.Build) void { |
| 12 | 12 | .cpu_arch = .x86, |
| 13 | 13 | .os_tag = .freestanding, |
| 14 | 14 | }), |
| 15 | .optimize = .ReleaseSmall, | |
| 15 | .optimize = .small, | |
| 16 | 16 | }), |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | 19 | const exe = b.addTest(.{ .root_module = b.createModule(.{ |
| 20 | 20 | .root_source_file = b.path("main.zig"), |
| 21 | 21 | .target = b.graph.host, |
| 22 | .optimize = .Debug, | |
| 22 | .optimize = .debug, | |
| 23 | 23 | }) }); |
| 24 | 24 | exe.root_module.addAnonymousImport("bootloader.elf", .{ |
| 25 | 25 | .root_source_file = bootloader.getEmittedBin(), |
test/standalone/emit_asm_no_bin/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const obj = b.addObject(.{ |
| 10 | 10 | .name = "main", |
test/standalone/emit_llvm_no_bin/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const obj = b.addObject(.{ |
| 10 | 10 | .name = "main", |
test/standalone/empty_env/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | |
| 10 | 10 | if (builtin.os.tag == .windows and b.graph.environ_map.contains("ConEmuHWND")) { |
| 11 | 11 | // ConEmu injects environment variables into processes before they are executed |
test/standalone/entry_point/build.zig+2-2| ... | ... | @@ -6,7 +6,7 @@ pub fn build(b: *std.Build) !void { |
| 6 | 6 | .target = b.resolveTargetQuery(try .parse(.{ |
| 7 | 7 | .arch_os_abi = "x86_64-linux", |
| 8 | 8 | })), |
| 9 | .optimize = .ReleaseFast, // non-Debug build for reproducible output | |
| 9 | .optimize = .fast, // non-Debug build for reproducible output | |
| 10 | 10 | .root_source_file = b.path("main.zig"), |
| 11 | 11 | }); |
| 12 | 12 | |
| ... | ... | @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) !void { |
| 29 | 29 | .name = "check_differ", |
| 30 | 30 | .root_module = b.createModule(.{ |
| 31 | 31 | .target = b.graph.host, |
| 32 | .optimize = .Debug, | |
| 32 | .optimize = .debug, | |
| 33 | 33 | .root_source_file = b.path("check_differ.zig"), |
| 34 | 34 | }), |
| 35 | 35 | }); |
test/standalone/env_vars/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | |
| 10 | 10 | const main = b.addExecutable(.{ |
| 11 | 11 | .name = "main", |
test/standalone/extern/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const obj = b.addObject(.{ |
| 10 | 10 | .name = "exports", |
test/standalone/glibc_compat/build.zig+3-3| ... | ... | @@ -122,19 +122,19 @@ pub fn build(b: *std.Build) void { |
| 122 | 122 | const malloc_translation = b.addTranslateC(.{ |
| 123 | 123 | .root_source_file = b.path("include_malloc.h"), |
| 124 | 124 | .target = target, |
| 125 | .optimize = .Debug, | |
| 125 | .optimize = .debug, | |
| 126 | 126 | .link_libc = true, |
| 127 | 127 | }); |
| 128 | 128 | const stdlib_translation = b.addTranslateC(.{ |
| 129 | 129 | .root_source_file = b.path("include_stdlib.h"), |
| 130 | 130 | .target = target, |
| 131 | .optimize = .Debug, | |
| 131 | .optimize = .debug, | |
| 132 | 132 | .link_libc = true, |
| 133 | 133 | }); |
| 134 | 134 | const string_translation = b.addTranslateC(.{ |
| 135 | 135 | .root_source_file = b.path("include_string.h"), |
| 136 | 136 | .target = target, |
| 137 | .optimize = .Debug, | |
| 137 | .optimize = .debug, | |
| 138 | 138 | .link_libc = true, |
| 139 | 139 | }); |
| 140 | 140 | const exe = b.addExecutable(.{ |
test/standalone/global_linkage/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test the program"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.graph.host; |
| 9 | 9 | |
| 10 | 10 | const obj1 = b.addLibrary(.{ |
test/standalone/install_headers/build.zig+4-4| ... | ... | @@ -12,7 +12,7 @@ pub fn build(b: *std.Build) void { |
| 12 | 12 | .root_module = b.createModule(.{ |
| 13 | 13 | .root_source_file = null, |
| 14 | 14 | .target = b.resolveTargetQuery(.{}), |
| 15 | .optimize = .Debug, | |
| 15 | .optimize = .debug, | |
| 16 | 16 | }), |
| 17 | 17 | }); |
| 18 | 18 | libfoo.root_module.addCSourceFile(.{ .file = empty_c }); |
| ... | ... | @@ -22,7 +22,7 @@ pub fn build(b: *std.Build) void { |
| 22 | 22 | .root_module = b.createModule(.{ |
| 23 | 23 | .root_source_file = null, |
| 24 | 24 | .target = b.resolveTargetQuery(.{}), |
| 25 | .optimize = .Debug, | |
| 25 | .optimize = .debug, | |
| 26 | 26 | .link_libc = true, |
| 27 | 27 | }), |
| 28 | 28 | }); |
| ... | ... | @@ -68,7 +68,7 @@ pub fn build(b: *std.Build) void { |
| 68 | 68 | .root_module = b.createModule(.{ |
| 69 | 69 | .root_source_file = null, |
| 70 | 70 | .target = b.resolveTargetQuery(.{}), |
| 71 | .optimize = .Debug, | |
| 71 | .optimize = .debug, | |
| 72 | 72 | }), |
| 73 | 73 | }); |
| 74 | 74 | libbar.root_module.addCSourceFile(.{ .file = empty_c }); |
| ... | ... | @@ -93,7 +93,7 @@ pub fn build(b: *std.Build) void { |
| 93 | 93 | .root_module = b.createModule(.{ |
| 94 | 94 | .root_source_file = b.path("check_exists.zig"), |
| 95 | 95 | .target = b.resolveTargetQuery(.{}), |
| 96 | .optimize = .Debug, | |
| 96 | .optimize = .debug, | |
| 97 | 97 | }), |
| 98 | 98 | }); |
| 99 | 99 | const run_check_exists = b.addRunArtifact(check_exists); |
test/standalone/install_raw_hex/build.zig+1-1| ... | ... | @@ -12,7 +12,7 @@ pub fn build(b: *std.Build) void { |
| 12 | 12 | .abi = .gnueabihf, |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 15 | const optimize: std.builtin.Optimize = .debug; | |
| 16 | 16 | |
| 17 | 17 | const elf = b.addExecutable(.{ |
| 18 | 18 | .name = "zig-nrf52-blink.elf", |
test/standalone/ios/build.zig+1-1| ... | ... | @@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void { |
| 16 | 16 | .name = "main", |
| 17 | 17 | .root_module = b.createModule(.{ |
| 18 | 18 | .root_source_file = b.path("panic.zig"), |
| 19 | .optimize = .Debug, | |
| 19 | .optimize = .debug, | |
| 20 | 20 | .target = target, |
| 21 | 21 | .link_libc = true, |
| 22 | 22 | }), |
test/standalone/issue_11595/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag == .windows) { |
test/standalone/issue_12706/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | const exe = b.addExecutable(.{ |
test/standalone/issue_339/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.graph.host; |
| 9 | 9 | |
| 10 | 10 | const obj = b.addObject(.{ |
test/standalone/issue_5825/build.zig+1-1| ... | ... | @@ -13,7 +13,7 @@ pub fn build(b: *std.Build) void { |
| 13 | 13 | .os_tag = .windows, |
| 14 | 14 | .abi = .msvc, |
| 15 | 15 | }); |
| 16 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 16 | const optimize: std.builtin.Optimize = .debug; | |
| 17 | 17 | const obj = b.addObject(.{ |
| 18 | 18 | .name = "issue_5825", |
| 19 | 19 | .root_module = b.createModule(.{ |
test/standalone/load_dynamic_library/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag == .wasi) return; |
test/standalone/mix_c_files/build.zig+5-5| ... | ... | @@ -9,13 +9,13 @@ pub fn build(b: *std.Build) void { |
| 9 | 9 | return; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | add(b, test_step, .Debug); | |
| 13 | add(b, test_step, .ReleaseFast); | |
| 14 | add(b, test_step, .ReleaseSmall); | |
| 15 | add(b, test_step, .ReleaseSafe); | |
| 12 | add(b, test_step, .debug); | |
| 13 | add(b, test_step, .fast); | |
| 14 | add(b, test_step, .small); | |
| 15 | add(b, test_step, .safe); | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { | |
| 18 | fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize) void { | |
| 19 | 19 | const exe = b.addExecutable(.{ |
| 20 | 20 | .name = "test", |
| 21 | 21 | .root_module = b.createModule(.{ |
test/standalone/mix_o_files/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.graph.host; |
| 9 | 9 | |
| 10 | 10 | const obj = b.addObject(.{ |
test/standalone/pkg_import/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const exe = b.addExecutable(.{ |
| 10 | 10 | .name = "test", |
test/standalone/posix/build.zig+1-1| ... | ... | @@ -54,7 +54,7 @@ pub fn build(b: *std.Build) void { |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | fn run_exe(b: *std.Build, optimize: std.builtin.OptimizeMode, case: *const Case, target: std.Build.ResolvedTarget, link_libc: bool) *std.Build.Step.Run { | |
| 57 | fn run_exe(b: *std.Build, optimize: std.builtin.Optimize, case: *const Case, target: std.Build.ResolvedTarget, link_libc: bool) *std.Build.Step.Run { | |
| 58 | 58 | const exe_name = b.fmt("test-posix-{s}{s}{s}", .{ |
| 59 | 59 | std.fs.path.stem(case.src_path), |
| 60 | 60 | if (link_libc) "-libc" else "", |
test/standalone/run_cwd/build.zig+1-1| ... | ... | @@ -3,7 +3,7 @@ pub fn build(b: *Build) void { |
| 3 | 3 | .name = "check_file_exists", |
| 4 | 4 | .root_module = b.createModule(.{ |
| 5 | 5 | .target = b.graph.host, |
| 6 | .optimize = .Debug, | |
| 6 | .optimize = .debug, | |
| 7 | 7 | .root_source_file = b.path("check_file_exists.zig"), |
| 8 | 8 | }), |
| 9 | 9 | }); |
test/standalone/self_exe_symlink/build.zig+1-1| ... | ... | @@ -6,7 +6,7 @@ pub fn build(b: *std.Build) void { |
| 6 | 6 | const test_step = b.step("test", "Test it"); |
| 7 | 7 | b.default_step = test_step; |
| 8 | 8 | |
| 9 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 9 | const optimize: std.builtin.Optimize = .debug; | |
| 10 | 10 | const target = b.graph.host; |
| 11 | 11 | |
| 12 | 12 | if (target.result.os.tag == .netbsd) return; // F_GETPATH not reliable |
test/standalone/shared_library/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.standardTargetOptions(.{}); |
| 9 | 9 | |
| 10 | 10 | const exe_names: []const []const u8 = &.{ |
test/standalone/simple/build.zig+1-1| ... | ... | @@ -10,7 +10,7 @@ pub fn build(b: *std.Build) void { |
| 10 | 10 | const skip_release_fast = b.option(bool, "skip_release_fast", "Skip release-fast builds") orelse false; |
| 11 | 11 | const skip_release_small = b.option(bool, "skip_release_small", "Skip release-small builds") orelse false; |
| 12 | 12 | |
| 13 | var optimize_modes_buf: [4]std.builtin.OptimizeMode = undefined; | |
| 13 | var optimize_modes_buf: [4]std.builtin.Optimize = undefined; | |
| 14 | 14 | var optimize_modes_len: usize = 0; |
| 15 | 15 | if (!skip_debug) { |
| 16 | 16 | optimize_modes_buf[optimize_modes_len] = .debug; |
test/standalone/static_c_lib/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | const target = b.standardTargetOptions(.{}); |
| 9 | 9 | |
| 10 | 10 | const exe_names: []const []const u8 = &.{ |
test/standalone/strip_empty_loop/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test the program"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize = std.builtin.OptimizeMode.Debug; | |
| 7 | const optimize = std.builtin.Optimize.debug; | |
| 8 | 8 | const target = b.graph.host; |
| 9 | 9 | |
| 10 | 10 | const main = b.addExecutable(.{ |
test/standalone/strip_struct_init/build.zig+1-1| ... | ... | @@ -4,7 +4,7 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 7 | const optimize: std.builtin.Optimize = .debug; | |
| 8 | 8 | |
| 9 | 9 | const main = b.addTest(.{ |
| 10 | 10 | .root_module = b.createModule(.{ |
test/standalone/tsan/build.zig+2-2| ... | ... | @@ -29,7 +29,7 @@ pub fn build(b: *std.Build) !void { |
| 29 | 29 | .root_module = b.createModule(.{ |
| 30 | 30 | .root_source_file = b.path("main.zig"), |
| 31 | 31 | .target = target, |
| 32 | .optimize = .Debug, | |
| 32 | .optimize = .debug, | |
| 33 | 33 | .sanitize_thread = true, |
| 34 | 34 | }), |
| 35 | 35 | }); |
| ... | ... | @@ -46,7 +46,7 @@ pub fn build(b: *std.Build) !void { |
| 46 | 46 | .root_module = b.createModule(.{ |
| 47 | 47 | .root_source_file = b.path("main.zig"), |
| 48 | 48 | .target = target, |
| 49 | .optimize = .Debug, | |
| 49 | .optimize = .debug, | |
| 50 | 50 | .sanitize_thread = true, |
| 51 | 51 | }), |
| 52 | 52 | }); |
test/standalone/windows_argv/build.zig+1-1| ... | ... | @@ -7,7 +7,7 @@ pub fn build(b: *std.Build) !void { |
| 7 | 7 | |
| 8 | 8 | if (builtin.os.tag != .windows) return; |
| 9 | 9 | |
| 10 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 10 | const optimize: std.builtin.Optimize = .debug; | |
| 11 | 11 | |
| 12 | 12 | const lib_gnu = b.addLibrary(.{ |
| 13 | 13 | .linkage = .static, |
test/standalone/windows_bat_args/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) !void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag != .windows) return; |
test/standalone/windows_entry_points/build.zig+12-12| ... | ... | @@ -16,7 +16,7 @@ pub fn build(b: *std.Build) void { |
| 16 | 16 | .root_module = b.createModule(.{ |
| 17 | 17 | .root_source_file = null, |
| 18 | 18 | .target = target, |
| 19 | .optimize = .Debug, | |
| 19 | .optimize = .debug, | |
| 20 | 20 | .link_libc = true, |
| 21 | 21 | }), |
| 22 | 22 | }); |
| ... | ... | @@ -32,7 +32,7 @@ pub fn build(b: *std.Build) void { |
| 32 | 32 | .root_module = b.createModule(.{ |
| 33 | 33 | .root_source_file = null, |
| 34 | 34 | .target = target, |
| 35 | .optimize = .Debug, | |
| 35 | .optimize = .debug, | |
| 36 | 36 | .link_libc = true, |
| 37 | 37 | }), |
| 38 | 38 | }); |
| ... | ... | @@ -49,7 +49,7 @@ pub fn build(b: *std.Build) void { |
| 49 | 49 | .root_module = b.createModule(.{ |
| 50 | 50 | .root_source_file = null, |
| 51 | 51 | .target = target, |
| 52 | .optimize = .Debug, | |
| 52 | .optimize = .debug, | |
| 53 | 53 | .link_libc = true, |
| 54 | 54 | }), |
| 55 | 55 | }); |
| ... | ... | @@ -66,7 +66,7 @@ pub fn build(b: *std.Build) void { |
| 66 | 66 | .root_module = b.createModule(.{ |
| 67 | 67 | .root_source_file = null, |
| 68 | 68 | .target = target, |
| 69 | .optimize = .Debug, | |
| 69 | .optimize = .debug, | |
| 70 | 70 | .link_libc = true, |
| 71 | 71 | }), |
| 72 | 72 | }); |
| ... | ... | @@ -84,7 +84,7 @@ pub fn build(b: *std.Build) void { |
| 84 | 84 | .root_module = b.createModule(.{ |
| 85 | 85 | .root_source_file = b.path("main.zig"), |
| 86 | 86 | .target = target, |
| 87 | .optimize = .Debug, | |
| 87 | .optimize = .debug, | |
| 88 | 88 | }), |
| 89 | 89 | }); |
| 90 | 90 | |
| ... | ... | @@ -98,7 +98,7 @@ pub fn build(b: *std.Build) void { |
| 98 | 98 | .root_module = b.createModule(.{ |
| 99 | 99 | .root_source_file = b.path("main.zig"), |
| 100 | 100 | .target = target, |
| 101 | .optimize = .Debug, | |
| 101 | .optimize = .debug, | |
| 102 | 102 | .link_libc = true, |
| 103 | 103 | }), |
| 104 | 104 | }); |
| ... | ... | @@ -113,7 +113,7 @@ pub fn build(b: *std.Build) void { |
| 113 | 113 | .root_module = b.createModule(.{ |
| 114 | 114 | .root_source_file = b.path("wwinmain.zig"), |
| 115 | 115 | .target = target, |
| 116 | .optimize = .Debug, | |
| 116 | .optimize = .debug, | |
| 117 | 117 | }), |
| 118 | 118 | }); |
| 119 | 119 | exe.mingw_unicode_entry_point = true; |
| ... | ... | @@ -129,7 +129,7 @@ pub fn build(b: *std.Build) void { |
| 129 | 129 | .root_module = b.createModule(.{ |
| 130 | 130 | .root_source_file = b.path("wwinmain.zig"), |
| 131 | 131 | .target = target, |
| 132 | .optimize = .Debug, | |
| 132 | .optimize = .debug, | |
| 133 | 133 | .link_libc = true, |
| 134 | 134 | }), |
| 135 | 135 | }); |
| ... | ... | @@ -143,7 +143,7 @@ pub fn build(b: *std.Build) void { |
| 143 | 143 | const load_dll_exe = b.addExecutable(.{ .name = "load_dll", .root_module = b.createModule(.{ |
| 144 | 144 | .root_source_file = b.path("loaddll.zig"), |
| 145 | 145 | .target = target, |
| 146 | .optimize = .Debug, | |
| 146 | .optimize = .debug, | |
| 147 | 147 | }) }); |
| 148 | 148 | |
| 149 | 149 | { |
| ... | ... | @@ -153,7 +153,7 @@ pub fn build(b: *std.Build) void { |
| 153 | 153 | .root_module = b.createModule(.{ |
| 154 | 154 | .root_source_file = b.path("dllmain.zig"), |
| 155 | 155 | .target = target, |
| 156 | .optimize = .Debug, | |
| 156 | .optimize = .debug, | |
| 157 | 157 | }), |
| 158 | 158 | }); |
| 159 | 159 | |
| ... | ... | @@ -174,7 +174,7 @@ pub fn build(b: *std.Build) void { |
| 174 | 174 | .root_module = b.createModule(.{ |
| 175 | 175 | .root_source_file = b.path("dllmain.zig"), |
| 176 | 176 | .target = target, |
| 177 | .optimize = .Debug, | |
| 177 | .optimize = .debug, | |
| 178 | 178 | .link_libc = true, |
| 179 | 179 | }), |
| 180 | 180 | }); |
| ... | ... | @@ -195,7 +195,7 @@ pub fn build(b: *std.Build) void { |
| 195 | 195 | .linkage = .dynamic, |
| 196 | 196 | .root_module = b.createModule(.{ |
| 197 | 197 | .target = target, |
| 198 | .optimize = .Debug, | |
| 198 | .optimize = .debug, | |
| 199 | 199 | .link_libc = true, |
| 200 | 200 | }), |
| 201 | 201 | }); |
test/standalone/windows_paths/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag != .windows) return; |
test/standalone/windows_resources/build.zig+1-1| ... | ... | @@ -31,7 +31,7 @@ fn add( |
| 31 | 31 | .root_module = b.createModule(.{ |
| 32 | 32 | .root_source_file = b.path("main.zig"), |
| 33 | 33 | .target = target, |
| 34 | .optimize = .Debug, | |
| 34 | .optimize = .debug, | |
| 35 | 35 | }), |
| 36 | 36 | }); |
| 37 | 37 | exe.root_module.addWin32ResourceFile(.{ |
test/standalone/windows_spawn/build.zig+1-1| ... | ... | @@ -5,7 +5,7 @@ pub fn build(b: *std.Build) void { |
| 5 | 5 | const test_step = b.step("test", "Test it"); |
| 6 | 6 | b.default_step = test_step; |
| 7 | 7 | |
| 8 | const optimize: std.builtin.OptimizeMode = .Debug; | |
| 8 | const optimize: std.builtin.Optimize = .debug; | |
| 9 | 9 | const target = b.graph.host; |
| 10 | 10 | |
| 11 | 11 | if (builtin.os.tag != .windows) return; |
test/standalone/zerolength_check/build.zig+5-5| ... | ... | @@ -4,13 +4,13 @@ pub fn build(b: *std.Build) void { |
| 4 | 4 | const test_step = b.step("test", "Test it"); |
| 5 | 5 | b.default_step = test_step; |
| 6 | 6 | |
| 7 | add(b, test_step, .Debug); | |
| 8 | add(b, test_step, .ReleaseFast); | |
| 9 | add(b, test_step, .ReleaseSmall); | |
| 10 | add(b, test_step, .ReleaseSafe); | |
| 7 | add(b, test_step, .debug); | |
| 8 | add(b, test_step, .fast); | |
| 9 | add(b, test_step, .small); | |
| 10 | add(b, test_step, .safe); | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.OptimizeMode) void { | |
| 13 | fn add(b: *std.Build, test_step: *std.Build.Step, optimize: std.builtin.Optimize) void { | |
| 14 | 14 | const unit_tests = b.addTest(.{ .root_module = b.createModule(.{ |
| 15 | 15 | .root_source_file = b.path("src/main.zig"), |
| 16 | 16 | .target = b.resolveTargetQuery(.{ |
test/tests.zig+4-4| ... | ... | @@ -2,7 +2,7 @@ const std = @import("std"); |
| 2 | 2 | const builtin = @import("builtin"); |
| 3 | 3 | const assert = std.debug.assert; |
| 4 | 4 | const mem = std.mem; |
| 5 | const OptimizeMode = std.builtin.OptimizeMode; | |
| 5 | const OptimizeMode = std.builtin.Optimize; | |
| 6 | 6 | const Step = std.Build.Step; |
| 7 | 7 | |
| 8 | 8 | // Cases |
| ... | ... | @@ -21,7 +21,7 @@ pub const LinkContext = @import("src/Link.zig"); |
| 21 | 21 | const ModuleTestTarget = struct { |
| 22 | 22 | linkage: ?std.builtin.LinkMode = null, |
| 23 | 23 | target: std.Target.Query = .{}, |
| 24 | optimize_mode: std.builtin.OptimizeMode = .debug, | |
| 24 | optimize_mode: std.builtin.Optimize = .debug, | |
| 25 | 25 | link_libc: ?bool = null, |
| 26 | 26 | single_threaded: ?bool = null, |
| 27 | 27 | use_llvm: ?bool = null, |
| ... | ... | @@ -2162,7 +2162,7 @@ const c_abi_targets = blk: { |
| 2162 | 2162 | |
| 2163 | 2163 | const LinkTarget = struct { |
| 2164 | 2164 | target: std.Target.Query = .{}, |
| 2165 | optimize_mode: std.builtin.OptimizeMode = .debug, | |
| 2165 | optimize_mode: std.builtin.Optimize = .debug, | |
| 2166 | 2166 | link_libc: bool = false, |
| 2167 | 2167 | use_llvm: bool = false, |
| 2168 | 2168 | use_lld: bool = false, |
| ... | ... | @@ -2573,7 +2573,7 @@ pub fn addCliTests(b: *std.Build) *Step { |
| 2573 | 2573 | // This is intended to be the exact CLI usage used by godbolt.org. |
| 2574 | 2574 | const run = b.addSystemCommand(&.{ b.graph.zig_exe, "build-obj", "--cache-dir" }); |
| 2575 | 2575 | run.addDirectoryArg(tmp_path); |
| 2576 | run.addArgs(&.{ "--name", "example", "-fno-emit-bin", "-fno-emit-h", "-fstrip", "-OReleaseFast" }); | |
| 2576 | run.addArgs(&.{ "--name", "example", "-fno-emit-bin", "-fno-emit-h", "-fstrip", "-Ofast" }); | |
| 2577 | 2577 | run.addFileArg(example_zig); |
| 2578 | 2578 | const example_s = run.addPrefixedOutputFileArg("-femit-asm=", "example.s"); |
| 2579 | 2579 |
tools/doctest.zig+17-17| ... | ... | @@ -156,7 +156,7 @@ fn printOutput( |
| 156 | 156 | try shell_out.print("$ zig build-exe {s}.zig ", .{code_name}); |
| 157 | 157 | |
| 158 | 158 | switch (code.mode) { |
| 159 | .Debug => {}, | |
| 159 | .debug => {}, | |
| 160 | 160 | else => { |
| 161 | 161 | try build_args.appendSlice(&[_][]const u8{ "-O", @tagName(code.mode) }); |
| 162 | 162 | try shell_out.print("-O {s} ", .{@tagName(code.mode)}); |
| ... | ... | @@ -291,7 +291,7 @@ fn printOutput( |
| 291 | 291 | try shell_out.print("$ zig test {s}.zig ", .{code_name}); |
| 292 | 292 | |
| 293 | 293 | switch (code.mode) { |
| 294 | .Debug => {}, | |
| 294 | .debug => {}, | |
| 295 | 295 | else => { |
| 296 | 296 | try test_args.appendSlice(&[_][]const u8{ |
| 297 | 297 | "-O", @tagName(code.mode), |
| ... | ... | @@ -354,7 +354,7 @@ fn printOutput( |
| 354 | 354 | try shell_out.print("$ zig test {s}.zig ", .{code_name}); |
| 355 | 355 | |
| 356 | 356 | switch (code.mode) { |
| 357 | .Debug => {}, | |
| 357 | .debug => {}, | |
| 358 | 358 | else => { |
| 359 | 359 | try test_args.appendSlice(&[_][]const u8{ "-O", @tagName(code.mode) }); |
| 360 | 360 | try shell_out.print("-O {s} ", .{@tagName(code.mode)}); |
| ... | ... | @@ -404,18 +404,18 @@ fn printOutput( |
| 404 | 404 | } |
| 405 | 405 | var mode_arg: []const u8 = ""; |
| 406 | 406 | switch (code.mode) { |
| 407 | .Debug => {}, | |
| 408 | .ReleaseSafe => { | |
| 409 | try test_args.append("-OReleaseSafe"); | |
| 410 | mode_arg = "-OReleaseSafe"; | |
| 407 | .debug => {}, | |
| 408 | .safe => { | |
| 409 | try test_args.append("-Osafe"); | |
| 410 | mode_arg = "-Osafe"; | |
| 411 | 411 | }, |
| 412 | .ReleaseFast => { | |
| 413 | try test_args.append("-OReleaseFast"); | |
| 414 | mode_arg = "-OReleaseFast"; | |
| 412 | .fast => { | |
| 413 | try test_args.append("-Ofast"); | |
| 414 | mode_arg = "-Ofast"; | |
| 415 | 415 | }, |
| 416 | .ReleaseSmall => { | |
| 417 | try test_args.append("-OReleaseSmall"); | |
| 418 | mode_arg = "-OReleaseSmall"; | |
| 416 | .small => { | |
| 417 | try test_args.append("-Osmall"); | |
| 418 | mode_arg = "-Osmall"; | |
| 419 | 419 | }, |
| 420 | 420 | } |
| 421 | 421 | |
| ... | ... | @@ -468,7 +468,7 @@ fn printOutput( |
| 468 | 468 | try shell_out.print("$ zig build-obj {s}.zig ", .{code_name}); |
| 469 | 469 | |
| 470 | 470 | switch (code.mode) { |
| 471 | .Debug => {}, | |
| 471 | .debug => {}, | |
| 472 | 472 | else => { |
| 473 | 473 | try build_args.appendSlice(&[_][]const u8{ "-O", @tagName(code.mode) }); |
| 474 | 474 | try shell_out.print("-O {s} ", .{@tagName(code.mode)}); |
| ... | ... | @@ -548,7 +548,7 @@ fn printOutput( |
| 548 | 548 | try shell_out.print("$ zig build-lib {s}.zig ", .{code_name}); |
| 549 | 549 | |
| 550 | 550 | switch (code.mode) { |
| 551 | .Debug => {}, | |
| 551 | .debug => {}, | |
| 552 | 552 | else => { |
| 553 | 553 | try test_args.appendSlice(&[_][]const u8{ "-O", @tagName(code.mode) }); |
| 554 | 554 | try shell_out.print("-O {s} ", .{@tagName(code.mode)}); |
| ... | ... | @@ -843,7 +843,7 @@ fn writeEscapedLines(out: *Writer, text: []const u8) !void { |
| 843 | 843 | |
| 844 | 844 | const Code = struct { |
| 845 | 845 | id: Id, |
| 846 | mode: std.builtin.OptimizeMode, | |
| 846 | mode: std.builtin.Optimize, | |
| 847 | 847 | link_objects: []const []const u8, |
| 848 | 848 | target_str: ?[]const u8, |
| 849 | 849 | link_libc: bool, |
| ... | ... | @@ -903,7 +903,7 @@ fn parseManifest(arena: Allocator, source_bytes: []const u8) !Code { |
| 903 | 903 | else |
| 904 | 904 | fatal("unrecognized manifest id: '{s}'", .{first_line}); |
| 905 | 905 | |
| 906 | var mode: std.builtin.OptimizeMode = .Debug; | |
| 906 | var mode: std.builtin.Optimize = .debug; | |
| 907 | 907 | var link_mode: ?std.builtin.LinkMode = null; |
| 908 | 908 | var link_objects: std.ArrayList([]const u8) = .empty; |
| 909 | 909 | var additional_options: std.ArrayList([]const u8) = .empty; |
tools/migrate_langref.zig+4-4| ... | ... | @@ -243,7 +243,7 @@ const Code = struct { |
| 243 | 243 | name: []const u8, |
| 244 | 244 | source_token: Token, |
| 245 | 245 | just_check_syntax: bool, |
| 246 | mode: std.builtin.OptimizeMode, | |
| 246 | mode: std.builtin.Optimize, | |
| 247 | 247 | link_objects: []const []const u8, |
| 248 | 248 | target_str: ?[]const u8, |
| 249 | 249 | link_libc: bool, |
| ... | ... | @@ -319,7 +319,7 @@ fn walk(arena: Allocator, io: Io, tokenizer: *Tokenizer, out_dir: Dir, w: anytyp |
| 319 | 319 | return parseError(tokenizer, code_kind_tok, "unrecognized code kind: {s}", .{code_kind_str}); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | var mode: std.builtin.OptimizeMode = .debug; | |
| 322 | var mode: std.builtin.Optimize = .debug; | |
| 323 | 323 | var link_objects = std.array_list.Managed([]const u8).init(arena); |
| 324 | 324 | var target_str: ?[]const u8 = null; |
| 325 | 325 | var link_libc = false; |
| ... | ... | @@ -333,9 +333,9 @@ fn walk(arena: Allocator, io: Io, tokenizer: *Tokenizer, out_dir: Dir, w: anytyp |
| 333 | 333 | const end_code_tag = try eatToken(tokenizer, .tag_content); |
| 334 | 334 | const end_tag_name = tokenizer.buffer[end_code_tag.start..end_code_tag.end]; |
| 335 | 335 | if (mem.eql(u8, end_tag_name, "code_release_fast")) { |
| 336 | mode = .ReleaseFast; | |
| 336 | mode = .fast; | |
| 337 | 337 | } else if (mem.eql(u8, end_tag_name, "code_release_safe")) { |
| 338 | mode = .ReleaseSafe; | |
| 338 | mode = .safe; | |
| 339 | 339 | } else if (mem.eql(u8, end_tag_name, "code_disable_cache")) { |
| 340 | 340 | disable_cache = true; |
| 341 | 341 | } else if (mem.eql(u8, end_tag_name, "code_link_object")) { |