diff options
| author | Michael Dusan <michael.dusan@gmail.com> | 2023-09-04 13:40:42 -0400 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2023-09-04 22:31:39 +0200 |
| commit | 64d03faae7f0f444149a179a1534c3488f59dca7 (patch) | |
| tree | aa7d54bd923849ab58bb1b276e06d8a128bddbde /src/Compilation.zig | |
| parent | fda087ed8183dfd1abdf93da1e2b1af948f1f54f (diff) | |
| download | zig-64d03faae7f0f444149a179a1534c3488f59dca7.tar.gz zig-64d03faae7f0f444149a179a1534c3488f59dca7.zip | |
Compilation: support --verbose_llvm_cpu_features
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 0816322f60..ae1e1072f3 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1048,6 +1048,18 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { break :blk buf.items[0 .. buf.items.len - 1 :0].ptr; } else null; + if (options.verbose_llvm_cpu_features) { + if (llvm_cpu_features) |cf| print: { + std.debug.getStderrMutex().lock(); + defer std.debug.getStderrMutex().unlock(); + const stderr = std.io.getStdErr().writer(); + nosuspend stderr.print("compilation: {s}\n", .{options.root_name}) catch break :print; + nosuspend stderr.print(" target: {s}\n", .{try options.target.zigTriple(arena)}) catch break :print; + nosuspend stderr.print(" cpu: {s}\n", .{options.target.cpu.model.name}) catch break :print; + nosuspend stderr.print(" features: {s}\n", .{cf}) catch {}; + } + } + const strip = options.strip orelse !target_util.hasDebugInfo(options.target); const red_zone = options.want_red_zone orelse target_util.hasRedZone(options.target); const omit_frame_pointer = options.omit_frame_pointer orelse (options.optimize_mode != .Debug); |
