aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFinn Plummer <finn.c.plum@gmail.com>2025-06-24 16:21:24 -0700
committerGitHub <noreply@github.com>2025-06-24 16:21:24 -0700
commite93a0d0d1ed790173e23247fa2833cdac30b8268 (patch)
treecdc16ea9ec3fa563493e07e973be2f4c7a144d81 /clang/lib/Frontend/CompilerInvocation.cpp
parent52fbefb281ea59f061d5ce3725d57ae60640c71f (diff)
downloadllvm-e93a0d0d1ed790173e23247fa2833cdac30b8268.zip
llvm-e93a0d0d1ed790173e23247fa2833cdac30b8268.tar.gz
llvm-e93a0d0d1ed790173e23247fa2833cdac30b8268.tar.bz2
[HLSL][RootSignature] Add `fdx-rootsignature-version` option to specify root signature version (#144813)
This pr provides the ability to specify the root signature version as a compiler option and to retain this in the root signature decl. It also updates the methods to serialize the version when dumping the declaration and to output the version when generating the metadata. - Update `DXContainer.hI` to define the root signature versions - Update `Options.td` and `LangOpts.h` to define the `fdx-rootsignature-version` compiler option - Update `Options.td` to provide an alias `force-rootsig-ver` in clang-dxc - Update `Decl.[h|cpp]` and `SeamHLSL.cpp` so that `RootSignatureDecl` will retain its version type - Updates `CGHLSLRuntime.cpp` to generate the extra metadata field - Add tests to illustrate Resolves https://github.com/llvm/llvm-project/issues/126557. Note: this does not implement validation based on versioning. https://github.com/llvm/llvm-project/issues/129940 is required to retrieve the version and use it for validations.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 5c52dc3..9e269ab 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -636,6 +636,10 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
Diags.Report(diag::err_drv_argument_not_allowed_with)
<< "-hlsl-entry" << GetInputKindName(IK);
+ if (Args.hasArg(OPT_fdx_rootsignature_version) && !LangOpts.HLSL)
+ Diags.Report(diag::err_drv_argument_not_allowed_with)
+ << "-fdx-rootsignature-version" << GetInputKindName(IK);
+
if (Args.hasArg(OPT_fgpu_allow_device_init) && !LangOpts.HIP)
Diags.Report(diag::warn_ignored_hip_only_option)
<< Args.getLastArg(OPT_fgpu_allow_device_init)->getAsString(Args);