| author | |
| committer | |
| log | 0461a64a93f0596e98b62d596bb547e5455577d2 |
| tree | bbf00bc95c15a411c4427e9fbf69d285404bc0d9 |
| parent | 72c68f698ed2153f2a9e3b2c7166fa03bb03ae1a |
| signature |
std.builtin.Mode is deprecated.11 files changed, 28 insertions(+), 28 deletions(-)
build.zig+5-5| ... | ... | @@ -400,22 +400,22 @@ pub fn build(b: *std.Build) !void { |
| 400 | 400 | test_cases_options.addOption(std.SemanticVersion, "semver", semver); |
| 401 | 401 | test_cases_options.addOption(?[]const u8, "test_filter", test_filter); |
| 402 | 402 | |
| 403 | var chosen_opt_modes_buf: [4]builtin.Mode = undefined; | |
| 403 | var chosen_opt_modes_buf: [4]builtin.OptimizeMode = undefined; | |
| 404 | 404 | var chosen_mode_index: usize = 0; |
| 405 | 405 | if (!skip_debug) { |
| 406 | chosen_opt_modes_buf[chosen_mode_index] = builtin.Mode.Debug; | |
| 406 | chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.Debug; | |
| 407 | 407 | chosen_mode_index += 1; |
| 408 | 408 | } |
| 409 | 409 | if (!skip_release_safe) { |
| 410 | chosen_opt_modes_buf[chosen_mode_index] = builtin.Mode.ReleaseSafe; | |
| 410 | chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseSafe; | |
| 411 | 411 | chosen_mode_index += 1; |
| 412 | 412 | } |
| 413 | 413 | if (!skip_release_fast) { |
| 414 | chosen_opt_modes_buf[chosen_mode_index] = builtin.Mode.ReleaseFast; | |
| 414 | chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseFast; | |
| 415 | 415 | chosen_mode_index += 1; |
| 416 | 416 | } |
| 417 | 417 | if (!skip_release_small) { |
| 418 | chosen_opt_modes_buf[chosen_mode_index] = builtin.Mode.ReleaseSmall; | |
| 418 | chosen_opt_modes_buf[chosen_mode_index] = builtin.OptimizeMode.ReleaseSmall; | |
| 419 | 419 | chosen_mode_index += 1; |
| 420 | 420 | } |
| 421 | 421 | const optimization_modes = chosen_opt_modes_buf[0..chosen_mode_index]; |
lib/std/Build.zig+9-9| ... | ... | @@ -475,7 +475,7 @@ pub const ExecutableOptions = struct { |
| 475 | 475 | root_source_file: ?LazyPath = null, |
| 476 | 476 | version: ?std.SemanticVersion = null, |
| 477 | 477 | target: CrossTarget = .{}, |
| 478 | optimize: std.builtin.Mode = .Debug, | |
| 478 | optimize: std.builtin.OptimizeMode = .Debug, | |
| 479 | 479 | linkage: ?Step.Compile.Linkage = null, |
| 480 | 480 | max_rss: usize = 0, |
| 481 | 481 | link_libc: ?bool = null, |
| ... | ... | @@ -509,7 +509,7 @@ pub const ObjectOptions = struct { |
| 509 | 509 | name: []const u8, |
| 510 | 510 | root_source_file: ?LazyPath = null, |
| 511 | 511 | target: CrossTarget, |
| 512 | optimize: std.builtin.Mode, | |
| 512 | optimize: std.builtin.OptimizeMode, | |
| 513 | 513 | max_rss: usize = 0, |
| 514 | 514 | link_libc: ?bool = null, |
| 515 | 515 | single_threaded: ?bool = null, |
| ... | ... | @@ -541,7 +541,7 @@ pub const SharedLibraryOptions = struct { |
| 541 | 541 | root_source_file: ?LazyPath = null, |
| 542 | 542 | version: ?std.SemanticVersion = null, |
| 543 | 543 | target: CrossTarget, |
| 544 | optimize: std.builtin.Mode, | |
| 544 | optimize: std.builtin.OptimizeMode, | |
| 545 | 545 | max_rss: usize = 0, |
| 546 | 546 | link_libc: ?bool = null, |
| 547 | 547 | single_threaded: ?bool = null, |
| ... | ... | @@ -574,7 +574,7 @@ pub const StaticLibraryOptions = struct { |
| 574 | 574 | name: []const u8, |
| 575 | 575 | root_source_file: ?LazyPath = null, |
| 576 | 576 | target: CrossTarget, |
| 577 | optimize: std.builtin.Mode, | |
| 577 | optimize: std.builtin.OptimizeMode, | |
| 578 | 578 | version: ?std.SemanticVersion = null, |
| 579 | 579 | max_rss: usize = 0, |
| 580 | 580 | link_libc: ?bool = null, |
| ... | ... | @@ -608,7 +608,7 @@ pub const TestOptions = struct { |
| 608 | 608 | name: []const u8 = "test", |
| 609 | 609 | root_source_file: LazyPath, |
| 610 | 610 | target: CrossTarget = .{}, |
| 611 | optimize: std.builtin.Mode = .Debug, | |
| 611 | optimize: std.builtin.OptimizeMode = .Debug, | |
| 612 | 612 | version: ?std.SemanticVersion = null, |
| 613 | 613 | max_rss: usize = 0, |
| 614 | 614 | filter: ?[]const u8 = null, |
| ... | ... | @@ -644,7 +644,7 @@ pub const AssemblyOptions = struct { |
| 644 | 644 | name: []const u8, |
| 645 | 645 | source_file: LazyPath, |
| 646 | 646 | target: CrossTarget, |
| 647 | optimize: std.builtin.Mode, | |
| 647 | optimize: std.builtin.OptimizeMode, | |
| 648 | 648 | max_rss: usize = 0, |
| 649 | 649 | zig_lib_dir: ?LazyPath = null, |
| 650 | 650 | }; |
| ... | ... | @@ -1000,10 +1000,10 @@ pub fn step(self: *Build, name: []const u8, description: []const u8) *Step { |
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | 1002 | pub const StandardOptimizeOptionOptions = struct { |
| 1003 | preferred_optimize_mode: ?std.builtin.Mode = null, | |
| 1003 | preferred_optimize_mode: ?std.builtin.OptimizeMode = null, | |
| 1004 | 1004 | }; |
| 1005 | 1005 | |
| 1006 | pub fn standardOptimizeOption(self: *Build, options: StandardOptimizeOptionOptions) std.builtin.Mode { | |
| 1006 | pub fn standardOptimizeOption(self: *Build, options: StandardOptimizeOptionOptions) std.builtin.OptimizeMode { | |
| 1007 | 1007 | if (options.preferred_optimize_mode) |mode| { |
| 1008 | 1008 | if (self.option(bool, "release", "optimize for end users") orelse false) { |
| 1009 | 1009 | return mode; |
| ... | ... | @@ -1012,7 +1012,7 @@ pub fn standardOptimizeOption(self: *Build, options: StandardOptimizeOptionOptio |
| 1012 | 1012 | } |
| 1013 | 1013 | } else { |
| 1014 | 1014 | return self.option( |
| 1015 | std.builtin.Mode, | |
| 1015 | std.builtin.OptimizeMode, | |
| 1016 | 1016 | "optimize", |
| 1017 | 1017 | "Prioritize performance, safety, or binary size (-O flag)", |
| 1018 | 1018 | ) orelse .Debug; |
lib/std/Build/Step/Compile.zig+2-2| ... | ... | @@ -27,7 +27,7 @@ step: Step, |
| 27 | 27 | name: []const u8, |
| 28 | 28 | target: CrossTarget, |
| 29 | 29 | target_info: NativeTargetInfo, |
| 30 | optimize: std.builtin.Mode, | |
| 30 | optimize: std.builtin.OptimizeMode, | |
| 31 | 31 | linker_script: ?LazyPath = null, |
| 32 | 32 | version_script: ?[]const u8 = null, |
| 33 | 33 | out_filename: []const u8, |
| ... | ... | @@ -269,7 +269,7 @@ pub const Options = struct { |
| 269 | 269 | name: []const u8, |
| 270 | 270 | root_source_file: ?LazyPath = null, |
| 271 | 271 | target: CrossTarget, |
| 272 | optimize: std.builtin.Mode, | |
| 272 | optimize: std.builtin.OptimizeMode, | |
| 273 | 273 | kind: Kind, |
| 274 | 274 | linkage: ?Linkage = null, |
| 275 | 275 | version: ?std.SemanticVersion = null, |
lib/std/Build/Step/TranslateC.zig+1-1| ... | ... | @@ -49,7 +49,7 @@ pub const AddExecutableOptions = struct { |
| 49 | 49 | name: ?[]const u8 = null, |
| 50 | 50 | version: ?std.SemanticVersion = null, |
| 51 | 51 | target: ?CrossTarget = null, |
| 52 | optimize: ?std.builtin.Mode = null, | |
| 52 | optimize: ?std.builtin.OptimizeMode = null, | |
| 53 | 53 | linkage: ?Step.Compile.Linkage = null, |
| 54 | 54 | }; |
| 55 | 55 |
src/Compilation.zig+3-3| ... | ... | @@ -498,7 +498,7 @@ pub const InitOptions = struct { |
| 498 | 498 | /// this flag would be set to disable this machinery to avoid false positives. |
| 499 | 499 | disable_lld_caching: bool = false, |
| 500 | 500 | cache_mode: CacheMode = .incremental, |
| 501 | optimize_mode: std.builtin.Mode = .Debug, | |
| 501 | optimize_mode: std.builtin.OptimizeMode = .Debug, | |
| 502 | 502 | keep_source_files_loaded: bool = false, |
| 503 | 503 | clang_argv: []const []const u8 = &[0][]const u8{}, |
| 504 | 504 | lib_dirs: []const []const u8 = &[0][]const u8{}, |
| ... | ... | @@ -5348,7 +5348,7 @@ pub fn generateBuiltinZigSource(comp: *Compilation, allocator: Allocator) Alloca |
| 5348 | 5348 | \\ .ofmt = object_format, |
| 5349 | 5349 | \\}}; |
| 5350 | 5350 | \\pub const object_format = std.Target.ObjectFormat.{}; |
| 5351 | \\pub const mode = std.builtin.Mode.{}; | |
| 5351 | \\pub const mode = std.builtin.OptimizeMode.{}; | |
| 5352 | 5352 | \\pub const link_libc = {}; |
| 5353 | 5353 | \\pub const link_libcpp = {}; |
| 5354 | 5354 | \\pub const have_error_return_tracing = {}; |
| ... | ... | @@ -5631,7 +5631,7 @@ pub fn addLinkLib(comp: *Compilation, lib_name: []const u8) !void { |
| 5631 | 5631 | |
| 5632 | 5632 | /// This decides the optimization mode for all zig-provided libraries, including |
| 5633 | 5633 | /// compiler-rt, libcxx, libc, libunwind, etc. |
| 5634 | pub fn compilerRtOptMode(comp: Compilation) std.builtin.Mode { | |
| 5634 | pub fn compilerRtOptMode(comp: Compilation) std.builtin.OptimizeMode { | |
| 5635 | 5635 | if (comp.debug_compiler_runtime_libs) { |
| 5636 | 5636 | return comp.bin_file.options.optimize_mode; |
| 5637 | 5637 | } |
src/Module.zig+1-1| ... | ... | @@ -5640,7 +5640,7 @@ pub fn getTarget(mod: Module) Target { |
| 5640 | 5640 | return mod.comp.bin_file.options.target; |
| 5641 | 5641 | } |
| 5642 | 5642 | |
| 5643 | pub fn optimizeMode(mod: Module) std.builtin.Mode { | |
| 5643 | pub fn optimizeMode(mod: Module) std.builtin.OptimizeMode { | |
| 5644 | 5644 | return mod.comp.bin_file.options.optimize_mode; |
| 5645 | 5645 | } |
| 5646 | 5646 |
src/link.zig+1-1| ... | ... | @@ -102,7 +102,7 @@ pub const Options = struct { |
| 102 | 102 | target: std.Target, |
| 103 | 103 | output_mode: std.builtin.OutputMode, |
| 104 | 104 | link_mode: std.builtin.LinkMode, |
| 105 | optimize_mode: std.builtin.Mode, | |
| 105 | optimize_mode: std.builtin.OptimizeMode, | |
| 106 | 106 | machine_code_model: std.builtin.CodeModel, |
| 107 | 107 | root_name: [:0]const u8, |
| 108 | 108 | /// Not every Compilation compiles .zig code! For example you could do `zig build-exe foo.o`. |
src/main.zig+2-2| ... | ... | @@ -765,7 +765,7 @@ fn buildOutputType( |
| 765 | 765 | arg_mode: ArgMode, |
| 766 | 766 | ) !void { |
| 767 | 767 | var color: Color = .auto; |
| 768 | var optimize_mode: std.builtin.Mode = .Debug; | |
| 768 | var optimize_mode: std.builtin.OptimizeMode = .Debug; | |
| 769 | 769 | var provided_name: ?[]const u8 = null; |
| 770 | 770 | var link_mode: ?std.builtin.LinkMode = null; |
| 771 | 771 | var dll_export_fns: ?bool = null; |
| ... | ... | @@ -1595,7 +1595,7 @@ fn buildOutputType( |
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | if (optimize_mode_string) |s| { |
| 1598 | optimize_mode = std.meta.stringToEnum(std.builtin.Mode, s) orelse | |
| 1598 | optimize_mode = std.meta.stringToEnum(std.builtin.OptimizeMode, s) orelse | |
| 1599 | 1599 | fatal("unrecognized optimization mode: '{s}'", .{s}); |
| 1600 | 1600 | } |
| 1601 | 1601 | }, |
src/target.zig+1-1| ... | ... | @@ -441,7 +441,7 @@ pub fn hasDebugInfo(target: std.Target) bool { |
| 441 | 441 | return true; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | pub fn defaultCompilerRtOptimizeMode(target: std.Target) std.builtin.Mode { | |
| 444 | pub fn defaultCompilerRtOptimizeMode(target: std.Target) std.builtin.OptimizeMode { | |
| 445 | 445 | if (target.cpu.arch.isWasm() and target.os.tag == .freestanding) { |
| 446 | 446 | return .ReleaseSmall; |
| 447 | 447 | } else { |
test/src/Cases.zig+1-1| ... | ... | @@ -74,7 +74,7 @@ pub const Case = struct { |
| 74 | 74 | /// In order to be able to run e.g. Execution updates, this must be set |
| 75 | 75 | /// to Executable. |
| 76 | 76 | output_mode: std.builtin.OutputMode, |
| 77 | optimize_mode: std.builtin.Mode = .Debug, | |
| 77 | optimize_mode: std.builtin.OptimizeMode = .Debug, | |
| 78 | 78 | updates: std.ArrayList(Update), |
| 79 | 79 | emit_bin: bool = true, |
| 80 | 80 | emit_h: bool = false, |
tools/docgen.zig+2-2| ... | ... | @@ -323,7 +323,7 @@ const Code = struct { |
| 323 | 323 | name: []const u8, |
| 324 | 324 | source_token: Token, |
| 325 | 325 | just_check_syntax: bool, |
| 326 | mode: std.builtin.Mode, | |
| 326 | mode: std.builtin.OptimizeMode, | |
| 327 | 327 | link_objects: []const []const u8, |
| 328 | 328 | target_str: ?[]const u8, |
| 329 | 329 | link_libc: bool, |
| ... | ... | @@ -589,7 +589,7 @@ fn genToc(allocator: Allocator, tokenizer: *Tokenizer) !Toc { |
| 589 | 589 | return parseError(tokenizer, code_kind_tok, "unrecognized code kind: {s}", .{code_kind_str}); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | var mode: std.builtin.Mode = .Debug; | |
| 592 | var mode: std.builtin.OptimizeMode = .Debug; | |
| 593 | 593 | var link_objects = std.ArrayList([]const u8).init(allocator); |
| 594 | 594 | defer link_objects.deinit(); |
| 595 | 595 | var target_str: ?[]const u8 = null; |