From ceff2782029672714ac2e04a7b3e25af23eb9a9b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 20 Apr 2023 15:09:33 -0700 Subject: fixes to the previous commit * CompileStep: Avoid calling producesPdbFile() to determine whether the option should be respected. If the user asks for it, put it on the command line and let the Zig CLI deal with it appropriately. * Make the namespace of `std.dwarf.Format.dwarf32` no longer have a redundant "dwarf" in it. * Add `zig cc` integration for `-gdwarf32` and `-gdwarf64`. * Toss in a bonus bug fix for `-gdwarf-2`, `-gdwarf-3`, etc. * Avoid using default init values for struct fields unnecessarily. * Add missing cache hash addition for the new option. --- src/codegen/llvm.zig | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/codegen/llvm.zig') diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig index 23d9af39e0..a081448155 100644 --- a/src/codegen/llvm.zig +++ b/src/codegen/llvm.zig @@ -433,14 +433,7 @@ pub const Object = struct { if (!options.strip) { switch (options.target.ofmt) { .coff => llvm_module.addModuleCodeViewFlag(), - else => { - const dwarf_format = options.dwarf_format orelse .dwarf32; - const produce_dwarf64 = switch (dwarf_format) { - .dwarf32 => false, - .dwarf64 => true, - }; - llvm_module.addModuleDebugInfoFlag(produce_dwarf64); - }, + else => llvm_module.addModuleDebugInfoFlag(options.dwarf_format == std.dwarf.Format.@"64"), } const di_builder = llvm_module.createDIBuilder(true); opt_di_builder = di_builder; -- cgit v1.2.3