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 {...@@ -1232,7 +1232,6 @@ pub const cache_helpers = struct {
1232 hh.add(mod.sanitize_thread);1232 hh.add(mod.sanitize_thread);
1233 hh.add(mod.fuzz);1233 hh.add(mod.fuzz);
1234 hh.add(mod.unwind_tables);1234 hh.add(mod.unwind_tables);
1235 hh.add(mod.structured_cfg);
1236 hh.add(mod.no_builtin);1235 hh.add(mod.no_builtin);
1237 hh.addListOfBytes(mod.cc_argv);1236 hh.addListOfBytes(mod.cc_argv);
1238 }1237 }
...@@ -7270,7 +7269,6 @@ fn buildOutputFromZig(...@@ -7270,7 +7269,6 @@ fn buildOutputFromZig(
7270 .unwind_tables = comp.root_mod.unwind_tables,7269 .unwind_tables = comp.root_mod.unwind_tables,
7271 .pic = comp.root_mod.pic,7270 .pic = comp.root_mod.pic,
7272 .optimize_mode = optimize_mode,7271 .optimize_mode = optimize_mode,
7273 .structured_cfg = comp.root_mod.structured_cfg,
7274 .no_builtin = true,7272 .no_builtin = true,
7275 .code_model = comp.root_mod.code_model,7273 .code_model = comp.root_mod.code_model,
7276 .error_tracing = false,7274 .error_tracing = false,
...@@ -7419,7 +7417,6 @@ pub fn build_crt_file(...@@ -7419,7 +7417,6 @@ pub fn build_crt_file(
7419 // Some CRT objects (e.g. musl's rcrt1.o and Scrt1.o) are opinionated about PIC.7417 // Some CRT objects (e.g. musl's rcrt1.o and Scrt1.o) are opinionated about PIC.
7420 .pic = options.pic orelse comp.root_mod.pic,7418 .pic = options.pic orelse comp.root_mod.pic,
7421 .optimize_mode = comp.compilerRtOptMode(),7419 .optimize_mode = comp.compilerRtOptMode(),
7422 .structured_cfg = comp.root_mod.structured_cfg,
7423 // Some libcs (e.g. musl) are opinionated about -fno-builtin.7420 // Some libcs (e.g. musl) are opinionated about -fno-builtin.
7424 .no_builtin = options.no_builtin orelse comp.root_mod.no_builtin,7421 .no_builtin = options.no_builtin orelse comp.root_mod.no_builtin,
7425 .code_model = comp.root_mod.code_model,7422 .code_model = comp.root_mod.code_model,
src/Module.zig-17
...@@ -42,8 +42,6 @@ sanitize_thread: bool,...@@ -42,8 +42,6 @@ sanitize_thread: bool,
42fuzz: bool,42fuzz: bool,
43unwind_tables: std.lang.UnwindTables,43unwind_tables: std.lang.UnwindTables,
44cc_argv: []const []const u8,44cc_argv: []const []const u8,
45/// (SPIR-V) whether to generate a structured control flow graph or not
46structured_cfg: bool,
47no_builtin: bool,45no_builtin: bool,
4846
49pub const Deps = std.array_hash_map.String(*Module);47pub const Deps = std.array_hash_map.String(*Module);
...@@ -85,7 +83,6 @@ pub const CreateOptions = struct {...@@ -85,7 +83,6 @@ pub const CreateOptions = struct {
85 sanitize_c: ?std.zig.SanitizeC = null,83 sanitize_c: ?std.zig.SanitizeC = null,
86 sanitize_thread: ?bool = null,84 sanitize_thread: ?bool = null,
87 fuzz: ?bool = null,85 fuzz: ?bool = null,
88 structured_cfg: ?bool = null,
89 no_builtin: ?bool = null,86 no_builtin: ?bool = null,
90 };87 };
91};88};
...@@ -320,17 +317,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {...@@ -320,17 +317,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {
320 break :sp target_util.default_stack_protector_buffer_size;317 break :sp target_util.default_stack_protector_buffer_size;
321 };318 };
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
334 const no_builtin = b: {320 const no_builtin = b: {
335 if (options.inherited.no_builtin) |x| break :b x;321 if (options.inherited.no_builtin) |x| break :b x;
336 if (options.parent) |p| break :b p.no_builtin;322 if (options.parent) |p| break :b p.no_builtin;
...@@ -411,7 +397,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {...@@ -411,7 +397,6 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Module {
411 .fuzz = fuzz,397 .fuzz = fuzz,
412 .unwind_tables = unwind_tables,398 .unwind_tables = unwind_tables,
413 .cc_argv = options.cc_argv,399 .cc_argv = options.cc_argv,
414 .structured_cfg = structured_cfg,
415 .no_builtin = no_builtin,400 .no_builtin = no_builtin,
416 };401 };
417 return mod;402 return mod;
...@@ -450,7 +435,6 @@ pub fn createLimited(gpa: Allocator, options: LimitedOptions) Allocator.Error!*M...@@ -450,7 +435,6 @@ pub fn createLimited(gpa: Allocator, options: LimitedOptions) Allocator.Error!*M
450 .fuzz = undefined,435 .fuzz = undefined,
451 .unwind_tables = undefined,436 .unwind_tables = undefined,
452 .cc_argv = undefined,437 .cc_argv = undefined,
453 .structured_cfg = undefined,
454 .no_builtin = undefined,438 .no_builtin = undefined,
455 };439 };
456 return mod;440 return mod;
...@@ -489,7 +473,6 @@ pub fn createBuiltin(arena: Allocator, opts: Builtin, dirs: std.zig.Directories)...@@ -489,7 +473,6 @@ pub fn createBuiltin(arena: Allocator, opts: Builtin, dirs: std.zig.Directories)
489 .stack_protector = 0,473 .stack_protector = 0,
490 .red_zone = false,474 .red_zone = false,
491 .sanitize_c = .off,475 .sanitize_c = .off,
492 .structured_cfg = false,
493 .no_builtin = false,476 .no_builtin = false,
494 };477 };
495 return new;478 return new;
src/libs/freebsd.zig-1
...@@ -1077,7 +1077,6 @@ fn buildSharedLib(...@@ -1077,7 +1077,6 @@ fn buildSharedLib(
1077 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,1077 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
1078 .valgrind = false,1078 .valgrind = false,
1079 .optimize_mode = optimize_mode,1079 .optimize_mode = optimize_mode,
1080 .structured_cfg = comp.root_mod.structured_cfg,
1081 },1080 },
1082 .global = config,1081 .global = config,
1083 .cc_argv = &.{},1082 .cc_argv = &.{},
src/libs/glibc.zig-1
...@@ -1223,7 +1223,6 @@ fn buildSharedLib(...@@ -1223,7 +1223,6 @@ fn buildSharedLib(
1223 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,1223 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
1224 .valgrind = false,1224 .valgrind = false,
1225 .optimize_mode = optimize_mode,1225 .optimize_mode = optimize_mode,
1226 .structured_cfg = comp.root_mod.structured_cfg,
1227 },1226 },
1228 .global = config,1227 .global = config,
1229 .cc_argv = &.{},1228 .cc_argv = &.{},
src/libs/libcxx.zig-2
...@@ -172,7 +172,6 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!...@@ -172,7 +172,6 @@ pub fn buildLibCxx(comp: *Compilation, prog_node: std.Progress.Node) BuildError!
172 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,172 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
173 .valgrind = false,173 .valgrind = false,
174 .optimize_mode = optimize_mode,174 .optimize_mode = optimize_mode,
175 .structured_cfg = comp.root_mod.structured_cfg,
176 .pic = if (target_util.supports_fpic(target)) true else null,175 .pic = if (target_util.supports_fpic(target)) true else null,
177 .code_model = comp.root_mod.code_model,176 .code_model = comp.root_mod.code_model,
178 },177 },
...@@ -366,7 +365,6 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr...@@ -366,7 +365,6 @@ pub fn buildLibCxxAbi(comp: *Compilation, prog_node: std.Progress.Node) BuildErr
366 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,365 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
367 .valgrind = false,366 .valgrind = false,
368 .optimize_mode = optimize_mode,367 .optimize_mode = optimize_mode,
369 .structured_cfg = comp.root_mod.structured_cfg,
370 .unwind_tables = unwind_tables,368 .unwind_tables = unwind_tables,
371 .pic = if (target_util.supports_fpic(target)) true else null,369 .pic = if (target_util.supports_fpic(target)) true else null,
372 .code_model = comp.root_mod.code_model,370 .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...@@ -100,7 +100,6 @@ pub fn buildTsan(comp: *Compilation, prog_node: std.Progress.Node) BuildError!vo
100 .valgrind = false,100 .valgrind = false,
101 .unwind_tables = unwind_tables,101 .unwind_tables = unwind_tables,
102 .optimize_mode = optimize_mode,102 .optimize_mode = optimize_mode,
103 .structured_cfg = comp.root_mod.structured_cfg,
104 .pic = true,103 .pic = true,
105 .no_builtin = true,104 .no_builtin = true,
106 .code_model = comp.root_mod.code_model,105 .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...@@ -225,7 +225,6 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
225 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,225 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
226 .valgrind = false,226 .valgrind = false,
227 .optimize_mode = optimize_mode,227 .optimize_mode = optimize_mode,
228 .structured_cfg = comp.root_mod.structured_cfg,
229 },228 },
230 .global = config,229 .global = config,
231 .cc_argv = cc_argv,230 .cc_argv = cc_argv,
src/libs/netbsd.zig-1
...@@ -727,7 +727,6 @@ fn buildSharedLib(...@@ -727,7 +727,6 @@ fn buildSharedLib(
727 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,727 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
728 .valgrind = false,728 .valgrind = false,
729 .optimize_mode = optimize_mode,729 .optimize_mode = optimize_mode,
730 .structured_cfg = comp.root_mod.structured_cfg,
731 },730 },
732 .global = config,731 .global = config,
733 .cc_argv = &.{},732 .cc_argv = &.{},
src/libs/openbsd.zig-1
...@@ -647,7 +647,6 @@ fn buildSharedLib(...@@ -647,7 +647,6 @@ fn buildSharedLib(
647 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,647 .omit_frame_pointer = comp.root_mod.omit_frame_pointer,
648 .valgrind = false,648 .valgrind = false,
649 .optimize_mode = optimize_mode,649 .optimize_mode = optimize_mode,
650 .structured_cfg = comp.root_mod.structured_cfg,
651 },650 },
652 .global = config,651 .global = config,
653 .cc_argv = &.{},652 .cc_argv = &.{},
src/main.zig-14
...@@ -557,10 +557,6 @@ const usage_build_generic =...@@ -557,10 +557,6 @@ const usage_build_generic =
557 \\ -fno-function-sections All functions go into same section557 \\ -fno-function-sections All functions go into same section
558 \\ -fdata-sections Places each data in a separate section558 \\ -fdata-sections Places each data in a separate section
559 \\ -fno-data-sections All data go into same section559 \\ -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
564 \\ -mexec-model=[value] (WASI) Execution model560 \\ -mexec-model=[value] (WASI) Execution model
565 \\ -municode (Windows) Use wmain/wWinMain as entry point561 \\ -municode (Windows) Use wmain/wWinMain as entry point
566 \\ --time-report Send timing diagnostics to '--listen' clients562 \\ --time-report Send timing diagnostics to '--listen' clients
...@@ -1200,10 +1196,6 @@ fn buildOutputType(...@@ -1200,10 +1196,6 @@ fn buildOutputType(
1200 if (mem.eql(u8, next_arg, "--")) break;1196 if (mem.eql(u8, next_arg, "--")) break;
1201 try extra_rcflags.append(arena, next_arg);1197 try extra_rcflags.append(arena, next_arg);
1202 }1198 }
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;
1207 } else if (mem.eql(u8, arg, "--color")) {1199 } else if (mem.eql(u8, arg, "--color")) {
1208 const next_arg = args_iter.next() orelse {1200 const next_arg = args_iter.next() orelse {
1209 fatal("expected [auto|on|off] after --color", .{});1201 fatal("expected [auto|on|off] after --color", .{});
...@@ -1650,12 +1642,6 @@ fn buildOutputType(...@@ -1650,12 +1642,6 @@ fn buildOutputType(
1650 create_module.opts.debug_format = .{ .dwarf = .@"32" };1642 create_module.opts.debug_format = .{ .dwarf = .@"32" };
1651 } else if (mem.eql(u8, arg, "-gdwarf64")) {1643 } else if (mem.eql(u8, arg, "-gdwarf64")) {
1652 create_module.opts.debug_format = .{ .dwarf = .@"64" };1644 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", .{});
1659 } else if (mem.eql(u8, arg, "-fsingle-threaded")) {1645 } else if (mem.eql(u8, arg, "-fsingle-threaded")) {
1660 mod_opts.single_threaded = true;1646 mod_opts.single_threaded = true;
1661 } else if (mem.eql(u8, arg, "-fno-single-threaded")) {1647 } else if (mem.eql(u8, arg, "-fno-single-threaded")) {