[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Joshua Batista via cfe-commits
https://github.com/bob80905 created https://github.com/llvm/llvm-project/pull/83938 Previously, clang-dxc.exe would not recognize -HV as a valid argument to DXC, and would be unable to translate the argument to a legal clang argument. This PR implements a translation of the HV option and its v

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-hlsl Author: Joshua Batista (bob80905) Changes Previously, clang-dxc.exe would not recognize -HV as a valid argument to DXC, and would be unable to translate the argument to a legal clang argument. This PR implements a translation of the HV option and

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: Joshua Batista (bob80905) Changes Previously, clang-dxc.exe would not recognize -HV as a valid argument to DXC, and would be unable to translate the argument to a legal clang argument. This PR implements a translation of the HV opt

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Chris B via cfe-commits
@@ -226,6 +226,28 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch, A->claim(); continue; } +if (A->getOption().getID() == options::OPT_dxc_hlsl_version) { + // Translate -HV into -std for llvm + // depending on the

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Chris B via cfe-commits
https://github.com/llvm-beanz commented: I worry this pattern will also lend to us having multiple places that parse and translate HLSL versions. Can you look at other places in Clang where we handle these numbers and see if there is a good way to unify the string handling? It would be ideal f

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Chris B via cfe-commits
https://github.com/llvm-beanz edited https://github.com/llvm/llvm-project/pull/83938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Chris B via cfe-commits
@@ -226,6 +226,28 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch, A->claim(); continue; } +if (A->getOption().getID() == options::OPT_dxc_hlsl_version) { + // Translate -HV into -std for llvm + // depending on the

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Justin Bogner via cfe-commits
@@ -0,0 +1,13 @@ +// RUN: %clang_dxc -T lib_6_4 -HV 2016 %s 2>&1 -### | FileCheck -check-prefix=2016 %s +// RUN: %clang_dxc -T lib_6_4 -HV 2017 %s 2>&1 -### | FileCheck -check-prefix=2017 %s +// RUN: %clang_dxc -T lib_6_4 -HV 2018 %s 2>&1 -### | FileCheck -check-prefix=20

[clang] [HLSL] Add -HV option translation to clang-dxc.exe (PR #83938)

2024-03-04 Thread Justin Bogner via cfe-commits
@@ -8545,6 +8545,10 @@ def dxc_entrypoint : Option<["--", "/", "-"], "E", KIND_JOINED_OR_SEPARATE>, Group, Visibility<[DXCOption]>, HelpText<"Entry point name">; +def dxc_hlsl_version : Option<["--", "/", "-"], "HV