authorgravatar for mark.rushakoff@gmail.comMark Rushakoff <mark.rushakoff@gmail.com> 2026-01-25 22:33:49-05:00
committergravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-07-28 09:13:29+03:30
log8e6aa0a7ec968be26b451da95fd88398833904e7
tree77bc7882aa8dda01331a59006bea61a7e4a8985a
parent1f1bee62e854ec9c75e8b49072d0c403c7f0a100

cli: address TODO to remove formatted-panics and structured-cfg flags

These flags were supposed to be removed after 0.15.0 was tagged, and that happened about five months ago. non-structured-cfg is also no longer supported by SPIR-V backend.

10 files changed, 0 insertions(+), 42 deletions(-)

src/Compilation.zig-3
......@@ -1232,7 +1232,6 @@ pub const cache_helpers = struct {
12321232 hh.add(mod.sanitize_thread);
12331233 hh.add(mod.fuzz);
12341234 hh.add(mod.unwind_tables);
1235 hh.add(mod.structured_cfg);
12361235 hh.add(mod.no_builtin);
12371236 hh.addListOfBytes(mod.cc_argv);
12381237 }
......@@ -7270,7 +7269,6 @@ fn buildOutputFromZig(
72707269 .unwind_tables = comp.root_mod.unwind_tables,
72717270 .pic = comp.root_mod.pic,
72727271 .optimize_mode = optimize_mode,
7273 .structured_cfg = comp.root_mod.structured_cfg,
72747272 .no_builtin = true,
72757273 .code_model = comp.root_mod.code_model,
72767274 .error_tracing = false,
......@@ -7419,7 +7417,6 @@ pub fn build_crt_file(
74197417 // Some CRT objects (e.g. musl's rcrt1.o and Scrt1.o) are opinionated about PIC.
74207418 .pic = options.pic orelse comp.root_mod.pic,
74217419 .optimize_mode = comp.compilerRtOptMode(),
7422 .structured_cfg = comp.root_mod.structured_cfg,
74237420 // Some libcs (e.g. musl) are opinionated about -fno-builtin.
74247421 .no_builtin = options.no_builtin orelse comp.root_mod.no_builtin,
74257422 .code_model = comp.root_mod.code_model,
src/Module.zig-17
......@@ -42,8 +42,6 @@ sanitize_thread: bool,
4242fuzz: bool,
4343unwind_tables: std.lang.UnwindTables,
4444cc_argv: []const []const u8,
45/// (SPIR-V) whether to generate a structured control flow graph or not
46structured_cfg: bool,
4745no_builtin: bool,
4846
4947pub const Deps = std.array_hash_map.String(*Module);
......@@ -85,7 +83,6 @@ pub const CreateOptions = struct {
8583 sanitize_c: ?std.zig.SanitizeC = null,
8684 sanitize_thread: ?bool = null,
8785 fuzz: ?bool = null,
88 structured_cfg: ?bool = null,
8986 no_builtin: ?bool = null,
9087 };
9188};
......@@ -320,17 +317,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {
320317 break :sp target_util.default_stack_protector_buffer_size;
321318 };
322319
323 const structured_cfg = b: {
324 if (options.inherited.structured_cfg) |x| break :b x;
325 if (options.parent) |p| break :b p.structured_cfg;
326 // We always want a structured control flow in shaders. This option is
327 // only relevant for OpenCL kernels.
328 break :b switch (target.os.tag) {
329 .opencl => false,
330 else => true,
331 };
332 };
333
334320 const no_builtin = b: {
335321 if (options.inherited.no_builtin) |x| break :b x;
336322 if (options.parent) |p| break :b p.no_builtin;
......@@ -411,7 +397,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {
411397 .fuzz = fuzz,
412398 .unwind_tables = unwind_tables,
413399 .cc_argv = options.cc_argv,
414 .structured_cfg = structured_cfg,
415400 .no_builtin = no_builtin,
416401 };
417402 return mod;
......@@ -450,7 +435,6 @@ pub fn createLimited(gpa: Allocator, options: LimitedOptions) Allocator.Error!*M
450435 .fuzz = undefined,
451436 .unwind_tables = undefined,
452437 .cc_argv = undefined,
453 .structured_cfg = undefined,
454438 .no_builtin = undefined,
455439 };
456440 return mod;
......@@ -489,7 +473,6 @@ pub fn createBuiltin(arena: Allocator, opts: Builtin, dirs: std.zig.Directories)
489473 .stack_protector = 0,
490474 .red_zone = false,
491475 .sanitize_c = .off,
492 .structured_cfg = false,
493476 .no_builtin = false,
494477 };
495478 return new;
src/libs/freebsd.zig-1
......@@ -1077,7 +1077,6 @@ fn buildSharedLib(
10771077 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
10781078 .valgrind = false,
10791079 .optimize_mode = optimize_mode,
1080 .structured_cfg = comp.root_mod.structured_cfg,
10811080 },
10821081 .global = config,
10831082 .cc_argv = &.{},
src/libs/glibc.zig-1
......@@ -1223,7 +1223,6 @@ fn buildSharedLib(
12231223 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
12241224 .valgrind = false,
12251225 .optimize_mode = optimize_mode,
1226 .structured_cfg = comp.root_mod.structured_cfg,
12271226 },
12281227 .global = config,
12291228 .cc_argv = &.{},
src/libs/libcxx.zig-2
......@@ -172,7 +172,6 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
172172 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
173173 .valgrind = false,
174174 .optimize_mode = optimize_mode,
175 .structured_cfg = comp.root_mod.structured_cfg,
176175 .pic = if (target_util.supports_fpic(target)) true else null,
177176 .code_model = comp.root_mod.code_model,
178177 },
......@@ -366,7 +365,6 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
366365 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
367366 .valgrind = false,
368367 .optimize_mode = optimize_mode,
369 .structured_cfg = comp.root_mod.structured_cfg,
370368 .unwind_tables = unwind_tables,
371369 .pic = if (target_util.supports_fpic(target)) true else null,
372370 .code_model = comp.root_mod.code_model,
src/libs/libtsan.zig-1
......@@ -100,7 +100,6 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
100100 .valgrind = false,
101101 .unwind_tables = unwind_tables,
102102 .optimize_mode = optimize_mode,
103 .structured_cfg = comp.root_mod.structured_cfg,
104103 .pic = true,
105104 .no_builtin = true,
106105 .code_model = comp.root_mod.code_model,
src/libs/musl.zig-1
......@@ -225,7 +225,6 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
225225 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
226226 .valgrind = false,
227227 .optimize_mode = optimize_mode,
228 .structured_cfg = comp.root_mod.structured_cfg,
229228 },
230229 .global = config,
231230 .cc_argv = cc_argv,
src/libs/netbsd.zig-1
......@@ -727,7 +727,6 @@ fn buildSharedLib(
727727 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
728728 .valgrind = false,
729729 .optimize_mode = optimize_mode,
730 .structured_cfg = comp.root_mod.structured_cfg,
731730 },
732731 .global = config,
733732 .cc_argv = &.{},
src/libs/openbsd.zig-1
......@@ -647,7 +647,6 @@ fn buildSharedLib(
647647 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
648648 .valgrind = false,
649649 .optimize_mode = optimize_mode,
650 .structured_cfg = comp.root_mod.structured_cfg,
651650 },
652651 .global = config,
653652 .cc_argv = &.{},
src/main.zig-14
......@@ -557,10 +557,6 @@ const usage_build_generic =
557557 \\ -fno-function-sections All functions go into same section
558558 \\ -fdata-sections Places each data in a separate section
559559 \\ -fno-data-sections All data go into same section
560 \\ -fformatted-panics Enable formatted safety panics
561 \\ -fno-formatted-panics Disable formatted safety panics
562 \\ -fstructured-cfg (SPIR-V) force SPIR-V kernels to use structured control flow
563 \\ -fno-structured-cfg (SPIR-V) force SPIR-V kernels to not use structured control flow
564560 \\ -mexec-model=[value] (WASI) Execution model
565561 \\ -municode (Windows) Use wmain/wWinMain as entry point
566562 \\ --time-report Send timing diagnostics to '--listen' clients
......@@ -1200,10 +1196,6 @@ fn buildOutputType(
12001196 if (mem.eql(u8, next_arg, "--")) break;
12011197 try extra_rcflags.append(arena, next_arg);
12021198 }
1203 } else if (mem.eql(u8, arg, "-fstructured-cfg")) {
1204 mod_opts.structured_cfg = true;
1205 } else if (mem.eql(u8, arg, "-fno-structured-cfg")) {
1206 mod_opts.structured_cfg = false;
12071199 } else if (mem.eql(u8, arg, "--color")) {
12081200 const next_arg = args_iter.next() orelse {
12091201 fatal("expected [auto|on|off] after --color", .{});
......@@ -1650,12 +1642,6 @@ fn buildOutputType(
16501642 create_module.opts.debug_format = .{ .dwarf = .@"32" };
16511643 } else if (mem.eql(u8, arg, "-gdwarf64")) {
16521644 create_module.opts.debug_format = .{ .dwarf = .@"64" };
1653 } else if (mem.eql(u8, arg, "-fformatted-panics")) {
1654 // Remove this after 0.15.0 is tagged.
1655 warn("-fformatted-panics is deprecated and does nothing", .{});
1656 } else if (mem.eql(u8, arg, "-fno-formatted-panics")) {
1657 // Remove this after 0.15.0 is tagged.
1658 warn("-fno-formatted-panics is deprecated and does nothing", .{});
16591645 } else if (mem.eql(u8, arg, "-fsingle-threaded")) {
16601646 mod_opts.single_threaded = true;
16611647 } else if (mem.eql(u8, arg, "-fno-single-threaded")) {