[clang] d188916 - [Driver][DXC] Accept -f{no-, }discard-value-names in the DXC driver

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 19 01:48:34 PDT 2023


Author: Justin Bogner
Date: 2023-08-19T01:47:16-07:00
New Revision: d1889167b10a68bf25c284b040ee1ac4df844000

URL: https://github.com/llvm/llvm-project/commit/d1889167b10a68bf25c284b040ee1ac4df844000
DIFF: https://github.com/llvm/llvm-project/commit/d1889167b10a68bf25c284b040ee1ac4df844000.diff

LOG: [Driver][DXC] Accept -f{no-,}discard-value-names in the DXC driver

Added: 
    clang/test/Driver/dxc_valuenames.hlsl

Modified: 
    clang/include/clang/Driver/Options.td

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index f7c9bb854eb740..19a2abf494363c 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1870,9 +1870,11 @@ defm safe_buffer_usage_suggestions : BoolFOption<"safe-buffer-usage-suggestions"
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Display suggestions to update code associated with -Wunsafe-buffer-usage warnings">,
   NegFlag<SetFalse>>;
-def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">, Group<f_clang_Group>,
+def fdiscard_value_names : Flag<["-"], "fdiscard-value-names">,
+  Group<f_clang_Group>, Visibility<[ClangOption, DXCOption]>,
   HelpText<"Discard value names in LLVM IR">, Flags<[NoXarchOption]>;
-def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">, Group<f_clang_Group>,
+def fno_discard_value_names : Flag<["-"], "fno-discard-value-names">,
+  Group<f_clang_Group>, Visibility<[ClangOption, DXCOption]>,
   HelpText<"Do not discard value names in LLVM IR">, Flags<[NoXarchOption]>;
 defm dollars_in_identifiers : BoolFOption<"dollars-in-identifiers",
   LangOpts<"DollarIdents">, Default<!strconcat("!", asm_preprocessor.KeyPath)>,

diff  --git a/clang/test/Driver/dxc_valuenames.hlsl b/clang/test/Driver/dxc_valuenames.hlsl
new file mode 100644
index 00000000000000..29ee912e540468
--- /dev/null
+++ b/clang/test/Driver/dxc_valuenames.hlsl
@@ -0,0 +1,4 @@
+// RUN: %clang_dxc -### -T lib_6_6 -Fc - -fdiscard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-DISCARD-NAMES %s
+// RUN: %clang_dxc -### -T lib_6_6 -Fc - -fno-discard-value-names %s 2>&1 | FileCheck -check-prefix=CHECK-NO-DISCARD-NAMES %s
+// CHECK-DISCARD-NAMES: "-discard-value-names"
+// CHECK-NO-DISCARD-NAMES-NOT: "-discard-value-names"


        


More information about the cfe-commits mailing list