bogner created this revision. bogner added a reviewer: beanz. Herald added a subscriber: mcrosier. Herald added a project: All. bogner requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
This adds /Zi handling and explicitly ignores /Qembed_debug, which should make our command line handling compatible enough with dxc that we can share logic on compiler explorer. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D158113 Files: clang/include/clang/Driver/Options.td clang/test/Driver/dxc_debug.hlsl Index: clang/test/Driver/dxc_debug.hlsl =================================================================== --- /dev/null +++ clang/test/Driver/dxc_debug.hlsl @@ -0,0 +1,14 @@ +// RUN: %clang_dxc -Tlib_6_7 -### -g %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### /Zi %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### /Zi /Qembed_debug %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -Qembed_debug %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -gcodeview %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-CV +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -gdwarf %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-DWARF +// RUN: %clang_dxc -Tlib_6_7 -### -gcodeview -Zi %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-CV +// RUN: %clang_dxc -Tlib_6_7 -### -gdwarf -Zi %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-DWARF + +// CHECK: "-cc1" +// CHECK-CV-SAME: -gcodeview +// CHECK-SAME: "-debug-info-kind=constructor" +// CHECK-DWARF-SAME: -dwarf-version Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -7850,7 +7850,7 @@ def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">, HelpText<"Use SHA256 for file checksums in debug info">, Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>; -def _SLASH_Zi : CLFlag<"Zi">, Alias<g_Flag>, +def _SLASH_Zi : CLFlag<"Zi", [CLOption, DXCOption]>, Alias<g_Flag>, HelpText<"Like /Z7">; def _SLASH_Zp : CLJoined<"Zp">, HelpText<"Set default maximum struct packing alignment">, @@ -8183,3 +8183,6 @@ HelpText<"DXIL validator installation path">; def dxc_disable_validation : DXCFlag<"Vd">, HelpText<"Disable validation">; +def : Option<["/", "-"], "Qembed_debug", KIND_FLAG>, Group<dxc_Group>, + Flags<[Ignored, NoXarchOption]>, Visibility<[DXCOption]>, + HelpText<"Embed PDB in shader container (ignored)">;
Index: clang/test/Driver/dxc_debug.hlsl =================================================================== --- /dev/null +++ clang/test/Driver/dxc_debug.hlsl @@ -0,0 +1,14 @@ +// RUN: %clang_dxc -Tlib_6_7 -### -g %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### /Zi %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### /Zi /Qembed_debug %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -Qembed_debug %s 2>&1 | FileCheck %s +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -gcodeview %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-CV +// RUN: %clang_dxc -Tlib_6_7 -### -Zi -gdwarf %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-DWARF +// RUN: %clang_dxc -Tlib_6_7 -### -gcodeview -Zi %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-CV +// RUN: %clang_dxc -Tlib_6_7 -### -gdwarf -Zi %s 2>&1 | FileCheck %s -check-prefixes=CHECK,CHECK-DWARF + +// CHECK: "-cc1" +// CHECK-CV-SAME: -gcodeview +// CHECK-SAME: "-debug-info-kind=constructor" +// CHECK-DWARF-SAME: -dwarf-version Index: clang/include/clang/Driver/Options.td =================================================================== --- clang/include/clang/Driver/Options.td +++ clang/include/clang/Driver/Options.td @@ -7850,7 +7850,7 @@ def _SLASH_ZH_SHA_256 : CLFlag<"ZH:SHA_256">, HelpText<"Use SHA256 for file checksums in debug info">, Alias<gsrc_hash_EQ>, AliasArgs<["sha256"]>; -def _SLASH_Zi : CLFlag<"Zi">, Alias<g_Flag>, +def _SLASH_Zi : CLFlag<"Zi", [CLOption, DXCOption]>, Alias<g_Flag>, HelpText<"Like /Z7">; def _SLASH_Zp : CLJoined<"Zp">, HelpText<"Set default maximum struct packing alignment">, @@ -8183,3 +8183,6 @@ HelpText<"DXIL validator installation path">; def dxc_disable_validation : DXCFlag<"Vd">, HelpText<"Disable validation">; +def : Option<["/", "-"], "Qembed_debug", KIND_FLAG>, Group<dxc_Group>, + Flags<[Ignored, NoXarchOption]>, Visibility<[DXCOption]>, + HelpText<"Embed PDB in shader container (ignored)">;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits