[clang] [llvm] [HLSL][RootSignature] Plug-in serialization and add full sample testcase (PR #144769)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 23 11:11:03 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index e076b6f1f..17a1e242e 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -287,12 +287,11 @@ raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table) {
 }
 
 raw_ostream &operator<<(raw_ostream &OS, const DescriptorTableClause &Clause) {
-  OS << Clause.Type << "(" << Clause.Reg
-     << ", numDescriptors = ";
+  OS << Clause.Type << "(" << Clause.Reg << ", numDescriptors = ";
   if (Clause.NumDescriptors == NumDescriptorsUnbounded)
-     OS << "unbounded";
+    OS << "unbounded";
   else
-     OS << Clause.NumDescriptors;
+    OS << Clause.NumDescriptors;
   OS << ", space = " << Clause.Space << ", offset = ";
   if (Clause.Offset == DescriptorTableOffsetAppend)
     OS << "DescriptorTableOffsetAppend";
diff --git a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
index 600038fab..dde82ac34 100644
--- a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
+++ b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
@@ -44,8 +44,8 @@ TEST(HLSLRootSignatureTest, DescriptorSRVClauseDump) {
   OS << Clause;
   OS.flush();
 
-  std::string Expected =
-      "SRV(t0, numDescriptors = unbounded, space = 42, offset = 3, flags = None)";
+  std::string Expected = "SRV(t0, numDescriptors = unbounded, space = 42, "
+                         "offset = 3, flags = None)";
   EXPECT_EQ(Out, Expected);
 }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/144769


More information about the cfe-commits mailing list