https://github.com/inbelic created 
https://github.com/llvm/llvm-project/pull/143198

Implements serialization of the remaining completely defined `RootElement`s, 
namely `RootDescriptor`s and `RootFlag`s.

- Adds unit testing for the serialization methods

Resolves https://github.com/llvm/llvm-project/issues/138191
Resolves https://github.com/llvm/llvm-project/issues/138193

>From 749c7626701c9479a27648e76b070e7aa8eed0d4 Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 18:39:55 +0000
Subject: [PATCH 1/6] [HLSL][RootSignature] Implement serialization of
 `RootDescriptor`s

---
 .../Frontend/HLSL/HLSLRootSignatureUtils.h    |  3 +
 .../Frontend/HLSL/HLSLRootSignatureUtils.cpp  | 46 +++++++++++++++
 .../Frontend/HLSLRootSignatureDumpTest.cpp    | 56 +++++++++++++++++++
 3 files changed, 105 insertions(+)

diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h 
b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
index ca20e6719f3a4..20114abcf74a8 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
@@ -32,6 +32,9 @@ LLVM_ABI raw_ostream &operator<<(raw_ostream &OS, const 
RootFlags &Flags);
 LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
                                  const RootConstants &Constants);
 
+LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
+                                 const RootDescriptor &Descriptor);
+
 LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
                                  const DescriptorTableClause &Clause);
 
diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp 
b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index 24486a55ecf6a..d32765377e55e 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -132,6 +132,42 @@ static raw_ostream &operator<<(raw_ostream &OS,
   return OS;
 }
 
+static raw_ostream &operator<<(raw_ostream &OS,
+                               const RootDescriptorFlags &Flags) {
+  bool FlagSet = false;
+  unsigned Remaining = llvm::to_underlying(Flags);
+  while (Remaining) {
+    unsigned Bit = 1u << llvm::countr_zero(Remaining);
+    if (Remaining & Bit) {
+      if (FlagSet)
+        OS << " | ";
+
+      switch (static_cast<RootDescriptorFlags>(Bit)) {
+      case RootDescriptorFlags::DataVolatile:
+        OS << "DataVolatile";
+        break;
+      case RootDescriptorFlags::DataStaticWhileSetAtExecute:
+        OS << "DataStaticWhileSetAtExecute";
+        break;
+      case RootDescriptorFlags::DataStatic:
+        OS << "DataStatic";
+        break;
+      default:
+        OS << "invalid: " << Bit;
+        break;
+      }
+
+      FlagSet = true;
+    }
+    Remaining &= ~Bit;
+  }
+
+  if (!FlagSet)
+    OS << "None";
+
+  return OS;
+}
+
 raw_ostream &operator<<(raw_ostream &OS, const RootFlags &Flags) {
   OS << "RootFlags(";
   bool FlagSet = false;
@@ -205,6 +241,16 @@ raw_ostream &operator<<(raw_ostream &OS, const 
RootConstants &Constants) {
   return OS;
 }
 
+raw_ostream &operator<<(raw_ostream &OS, const RootDescriptor &Descriptor) {
+  ClauseType Type = ClauseType(llvm::to_underlying(Descriptor.Type));
+  OS << "Root" << Type << "(" << Descriptor.Reg
+     << ", space = " << Descriptor.Space
+     << ", visibility = " << Descriptor.Visibility
+     << ", flags = " << Descriptor.Flags << ")";
+
+  return OS;
+}
+
 raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table) {
   OS << "DescriptorTable(numClauses = " << Table.NumClauses
      << ", visibility = " << Table.Visibility << ")";
diff --git a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp 
b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
index 1a0c8e2a16396..6379bdd02c638 100644
--- a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
+++ b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
@@ -177,4 +177,60 @@ TEST(HLSLRootSignatureTest, AllRootFlagsDump) {
   EXPECT_EQ(Out, Expected);
 }
 
+TEST(HLSLRootSignatureTest, RootCBVDump) {
+  RootDescriptor Descriptor;
+  Descriptor.Type = DescriptorType::CBuffer;
+  Descriptor.Reg = {RegisterType::BReg, 0};
+  Descriptor.setDefaultFlags();
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  OS << Descriptor;
+  OS.flush();
+
+  std::string Expected = "RootCBV(b0, space = 0, "
+                         "visibility = All, "
+                         "flags = DataStaticWhileSetAtExecute)";
+  EXPECT_EQ(Out, Expected);
+}
+
+TEST(HLSLRootSignatureTest, RootSRVDump) {
+  RootDescriptor Descriptor;
+  Descriptor.Type = DescriptorType::SRV;
+  Descriptor.Reg = {RegisterType::TReg, 0};
+  Descriptor.Space = 42;
+  Descriptor.Visibility = ShaderVisibility::Geometry;
+  Descriptor.Flags = RootDescriptorFlags::None;
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  OS << Descriptor;
+  OS.flush();
+
+  std::string Expected =
+      "RootSRV(t0, space = 42, visibility = Geometry, flags = None)";
+  EXPECT_EQ(Out, Expected);
+}
+
+TEST(HLSLRootSignatureTest, RootUAVDump) {
+  RootDescriptor Descriptor;
+  Descriptor.Type = DescriptorType::UAV;
+  Descriptor.Reg = {RegisterType::UReg, 92374};
+  Descriptor.Space = 932847;
+  Descriptor.Visibility = ShaderVisibility::Hull;
+  Descriptor.Flags = RootDescriptorFlags::ValidFlags;
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  OS << Descriptor;
+  OS.flush();
+
+  std::string Expected =
+      "RootUAV(u92374, space = 932847, visibility = Hull, flags = "
+      "DataVolatile | "
+      "DataStaticWhileSetAtExecute | "
+      "DataStatic)";
+  EXPECT_EQ(Out, Expected);
+}
+
 } // namespace

>From 2b6ca2ec911a24b1dde663471ebbbc551c184c52 Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 18:57:33 +0000
Subject: [PATCH 2/6] [HLSL][RootSignature] Implement serialization of
 `StaicSampler`

- adds the easy cases
---
 .../llvm/Frontend/HLSL/HLSLRootSignatureUtils.h      |  3 +++
 llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp    | 12 ++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h 
b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
index 20114abcf74a8..7489777670703 100644
--- a/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
+++ b/llvm/include/llvm/Frontend/HLSL/HLSLRootSignatureUtils.h
@@ -35,6 +35,9 @@ LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
 LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
                                  const RootDescriptor &Descriptor);
 
+LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
+                                 const StaticSampler &StaticSampler);
+
 LLVM_ABI raw_ostream &operator<<(raw_ostream &OS,
                                  const DescriptorTableClause &Clause);
 
diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp 
b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index d32765377e55e..5bf79f21dbfc9 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -251,6 +251,18 @@ raw_ostream &operator<<(raw_ostream &OS, const 
RootDescriptor &Descriptor) {
   return OS;
 }
 
+raw_ostream &operator<<(raw_ostream &OS, const StaticSampler &Sampler) {
+  OS << "StaticSampler(" << Sampler.Reg
+     << ", mipLODBias = " << Sampler.MipLODBias
+     << ", maxAnisotropy = " << Sampler.MaxAnisotropy
+     << ", minLOD = " << Sampler.MinLOD
+     << ", maxLOD = " << Sampler.MaxLOD
+     << ", space = " << Sampler.Space
+     << ", visibility = " << Sampler.Visibility
+     << ")";
+  return OS;
+}
+
 raw_ostream &operator<<(raw_ostream &OS, const DescriptorTable &Table) {
   OS << "DescriptorTable(numClauses = " << Table.NumClauses
      << ", visibility = " << Table.Visibility << ")";

>From 7a34b48982c4d62ed4829dcc8944fbf12c21cebf Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 18:57:47 +0000
Subject: [PATCH 3/6] add serialization of Filter and TextureAddresMode enums

---
 .../Frontend/HLSL/HLSLRootSignatureUtils.cpp  | 144 ++++++++++++++++++
 1 file changed, 144 insertions(+)

diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp 
b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index 5bf79f21dbfc9..c225ef67ff2eb 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -71,6 +71,146 @@ static raw_ostream &operator<<(raw_ostream &OS,
   return OS;
 }
 
+
+static raw_ostream &operator<<(raw_ostream &OS,
+                               const SamplerFilter &Filter) {
+  switch (Filter) {
+  case SamplerFilter::MinMagMipPoint:
+    OS << "MinMagMipPoint";
+    break;
+  case SamplerFilter::MinMagPointMipLinear:
+    OS << "MinMagPointMipLinear";
+    break;
+  case SamplerFilter::MinPointMagLinearMipPoint:
+    OS << "MinPointMagLinearMipPoint";
+    break;
+  case SamplerFilter::MinPointMagMipLinear:
+    OS << "MinPointMagMipLinear";
+    break;
+  case SamplerFilter::MinLinearMagMipPoint:
+    OS << "MinLinearMagMipPoint";
+    break;
+  case SamplerFilter::MinLinearMagPointMipLinear:
+    OS << "MinLinearMagPointMipLinear";
+    break;
+  case SamplerFilter::MinMagLinearMipPoint:
+    OS << "MinMagLinearMipPoint";
+    break;
+  case SamplerFilter::MinMagMipLinear:
+    OS << "MinMagMipLinear";
+    break;
+  case SamplerFilter::Anisotropic:
+    OS << "Anisotropic";
+    break;
+  case SamplerFilter::ComparisonMinMagMipPoint:
+    OS << "ComparisonMinMagMipPoint";
+    break;
+  case SamplerFilter::ComparisonMinMagPointMipLinear:
+    OS << "ComparisonMinMagPointMipLinear";
+    break;
+  case SamplerFilter::ComparisonMinPointMagLinearMipPoint:
+    OS << "ComparisonMinPointMagLinearMipPoint";
+    break;
+  case SamplerFilter::ComparisonMinPointMagMipLinear:
+    OS << "ComparisonMinPointMagMipLinear";
+    break;
+  case SamplerFilter::ComparisonMinLinearMagMipPoint:
+    OS << "ComparisonMinLinearMagMipPoint";
+    break;
+  case SamplerFilter::ComparisonMinLinearMagPointMipLinear:
+    OS << "ComparisonMinLinearMagPointMipLinear";
+    break;
+  case SamplerFilter::ComparisonMinMagLinearMipPoint:
+    OS << "ComparisonMinMagLinearMipPoint";
+    break;
+  case SamplerFilter::ComparisonMinMagMipLinear:
+    OS << "ComparisonMinMagMipLinear";
+    break;
+  case SamplerFilter::ComparisonAnisotropic:
+    OS << "ComparisonAnisotropic";
+    break;
+  case SamplerFilter::MinimumMinMagMipPoint:
+    OS << "MinimumMinMagMipPoint";
+    break;
+  case SamplerFilter::MinimumMinMagPointMipLinear:
+    OS << "MinimumMinMagPointMipLinear";
+    break;
+  case SamplerFilter::MinimumMinPointMagLinearMipPoint:
+    OS << "MinimumMinPointMagLinearMipPoint";
+    break;
+  case SamplerFilter::MinimumMinPointMagMipLinear:
+    OS << "MinimumMinPointMagMipLinear";
+    break;
+  case SamplerFilter::MinimumMinLinearMagMipPoint:
+    OS << "MinimumMinLinearMagMipPoint";
+    break;
+  case SamplerFilter::MinimumMinLinearMagPointMipLinear:
+    OS << "MinimumMinLinearMagPointMipLinear";
+    break;
+  case SamplerFilter::MinimumMinMagLinearMipPoint:
+    OS << "MinimumMinMagLinearMipPoint";
+    break;
+  case SamplerFilter::MinimumMinMagMipLinear:
+    OS << "MinimumMinMagMipLinear";
+    break;
+  case SamplerFilter::MinimumAnisotropic:
+    OS << "MinimumAnisotropic";
+    break;
+  case SamplerFilter::MaximumMinMagMipPoint:
+    OS << "MaximumMinMagMipPoint";
+    break;
+  case SamplerFilter::MaximumMinMagPointMipLinear:
+    OS << "MaximumMinMagPointMipLinear";
+    break;
+  case SamplerFilter::MaximumMinPointMagLinearMipPoint:
+    OS << "MaximumMinPointMagLinearMipPoint";
+    break;
+  case SamplerFilter::MaximumMinPointMagMipLinear:
+    OS << "MaximumMinPointMagMipLinear";
+    break;
+  case SamplerFilter::MaximumMinLinearMagMipPoint:
+    OS << "MaximumMinLinearMagMipPoint";
+    break;
+  case SamplerFilter::MaximumMinLinearMagPointMipLinear:
+    OS << "MaximumMinLinearMagPointMipLinear";
+    break;
+  case SamplerFilter::MaximumMinMagLinearMipPoint:
+    OS << "MaximumMinMagLinearMipPoint";
+    break;
+  case SamplerFilter::MaximumMinMagMipLinear:
+    OS << "MaximumMinMagMipLinear";
+    break;
+  case SamplerFilter::MaximumAnisotropic:
+    OS << "MaximumAnisotropic";
+    break;
+  }
+
+  return OS;
+}
+
+static raw_ostream &operator<<(raw_ostream &OS,
+                               const TextureAddressMode &Address) {
+  switch (Address) {
+  case TextureAddressMode::Wrap:
+    OS << "Wrap";
+    break;
+  case TextureAddressMode::Mirror:
+    OS << "Mirror";
+    break;
+  case TextureAddressMode::Clamp:
+    OS << "Clamp";
+    break;
+  case TextureAddressMode::Border:
+    OS << "Border";
+    break;
+  case TextureAddressMode::MirrorOnce:
+    OS << "MirrorOnce";
+    break;
+  }
+
+  return OS;
+}
+
 static raw_ostream &operator<<(raw_ostream &OS, const ClauseType &Type) {
   switch (Type) {
   case ClauseType::CBuffer:
@@ -253,6 +393,10 @@ raw_ostream &operator<<(raw_ostream &OS, const 
RootDescriptor &Descriptor) {
 
 raw_ostream &operator<<(raw_ostream &OS, const StaticSampler &Sampler) {
   OS << "StaticSampler(" << Sampler.Reg
+     << ", filter = " << Sampler.Filter
+     << ", addressU = " << Sampler.AddressU
+     << ", addressV = " << Sampler.AddressV
+     << ", addressW = " << Sampler.AddressW
      << ", mipLODBias = " << Sampler.MipLODBias
      << ", maxAnisotropy = " << Sampler.MaxAnisotropy
      << ", minLOD = " << Sampler.MinLOD

>From 3163d7e915a62030b53308040b8260ef32b290d3 Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 19:55:12 +0000
Subject: [PATCH 4/6] add serialization of ComparisonFunc and StaticBorderColor

---
 .../Frontend/HLSL/HLSLRootSignatureUtils.cpp  | 58 +++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp 
b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index c225ef67ff2eb..7e6bbb257a58d 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -211,6 +211,62 @@ static raw_ostream &operator<<(raw_ostream &OS,
   return OS;
 }
 
+static raw_ostream &operator<<(raw_ostream &OS,
+                               const ComparisonFunc &CompFunc) {
+  switch (CompFunc) {
+  case ComparisonFunc::Never:
+    OS << "Never";
+    break;
+  case ComparisonFunc::Less:
+    OS << "Less";
+    break;
+  case ComparisonFunc::Equal:
+    OS << "Equal";
+    break;
+  case ComparisonFunc::LessEqual:
+    OS << "LessEqual";
+    break;
+  case ComparisonFunc::Greater:
+    OS << "Greater";
+    break;
+  case ComparisonFunc::NotEqual:
+    OS << "NotEqual";
+    break;
+  case ComparisonFunc::GreaterEqual:
+    OS << "GreaterEqual";
+    break;
+  case ComparisonFunc::Always:
+    OS << "Always";
+    break;
+  }
+
+  return OS;
+}
+
+
+static raw_ostream &operator<<(raw_ostream &OS,
+                               const StaticBorderColor &BorderColor) {
+  switch (BorderColor) {
+  case StaticBorderColor::TransparentBlack:
+    OS << "TransparentBlack";
+    break;
+  case StaticBorderColor::OpaqueBlack:
+    OS << "OpaqueBlack";
+    break;
+  case StaticBorderColor::OpaqueWhite:
+    OS << "OpaqueWhite";
+    break;
+  case StaticBorderColor::OpaqueBlackUint:
+    OS << "OpaqueBlackUint";
+    break;
+  case StaticBorderColor::OpaqueWhiteUint:
+    OS << "OpaqueWhiteUint";
+    break;
+  }
+
+  return OS;
+}
+
 static raw_ostream &operator<<(raw_ostream &OS, const ClauseType &Type) {
   switch (Type) {
   case ClauseType::CBuffer:
@@ -399,6 +455,8 @@ raw_ostream &operator<<(raw_ostream &OS, const 
StaticSampler &Sampler) {
      << ", addressW = " << Sampler.AddressW
      << ", mipLODBias = " << Sampler.MipLODBias
      << ", maxAnisotropy = " << Sampler.MaxAnisotropy
+     << ", comparisonFunc = " << Sampler.CompFunc
+     << ", borderColor = " << Sampler.BorderColor
      << ", minLOD = " << Sampler.MinLOD
      << ", maxLOD = " << Sampler.MaxLOD
      << ", space = " << Sampler.Space

>From 9d1b45e47aad460e3393d084bc62578a66a66f7f Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 19:55:17 +0000
Subject: [PATCH 5/6] add test cases

---
 .../Frontend/HLSLRootSignatureDumpTest.cpp    | 65 +++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp 
b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
index 6379bdd02c638..831c5dd585fab 100644
--- a/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
+++ b/llvm/unittests/Frontend/HLSLRootSignatureDumpTest.cpp
@@ -233,4 +233,69 @@ TEST(HLSLRootSignatureTest, RootUAVDump) {
   EXPECT_EQ(Out, Expected);
 }
 
+TEST(HLSLRootSignatureTest, DefaultStaticSamplerDump) {
+  StaticSampler Sampler;
+  Sampler.Reg = {RegisterType::SReg, 0};
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  OS << Sampler;
+  OS.flush();
+
+  std::string Expected = "StaticSampler(s0, "
+                         "filter = Anisotropic, "
+                         "addressU = Wrap, "
+                         "addressV = Wrap, "
+                         "addressW = Wrap, "
+                         "mipLODBias = 0.000000e+00, "
+                         "maxAnisotropy = 16, "
+                         "comparisonFunc = LessEqual, "
+                         "borderColor = OpaqueWhite, "
+                         "minLOD = 0.000000e+00, "
+                         "maxLOD = 3.402823e+38, "
+                         "space = 0, "
+                         "visibility = All"
+                         ")";
+  EXPECT_EQ(Out, Expected);
+}
+
+TEST(HLSLRootSignatureTest, DefinedStaticSamplerDump) {
+  StaticSampler Sampler;
+  Sampler.Reg = {RegisterType::SReg, 0};
+
+  Sampler.Filter = SamplerFilter::ComparisonMinMagLinearMipPoint;
+  Sampler.AddressU = TextureAddressMode::Mirror;
+  Sampler.AddressV = TextureAddressMode::Border;
+  Sampler.AddressW = TextureAddressMode::Clamp;
+  Sampler.MipLODBias = 4.8f;
+  Sampler.MaxAnisotropy = 32;
+  Sampler.CompFunc = ComparisonFunc::NotEqual;
+  Sampler.BorderColor = StaticBorderColor::OpaqueBlack;
+  Sampler.MinLOD = 1.0f;
+  Sampler.MaxLOD = 32.0f;
+  Sampler.Space = 7;
+  Sampler.Visibility = ShaderVisibility::Domain;
+
+  std::string Out;
+  llvm::raw_string_ostream OS(Out);
+  OS << Sampler;
+  OS.flush();
+
+  std::string Expected = "StaticSampler(s0, "
+                         "filter = ComparisonMinMagLinearMipPoint, "
+                         "addressU = Mirror, "
+                         "addressV = Border, "
+                         "addressW = Clamp, "
+                         "mipLODBias = 4.800000e+00, "
+                         "maxAnisotropy = 32, "
+                         "comparisonFunc = NotEqual, "
+                         "borderColor = OpaqueBlack, "
+                         "minLOD = 1.000000e+00, "
+                         "maxLOD = 3.200000e+01, "
+                         "space = 7, "
+                         "visibility = Domain"
+                         ")";
+  EXPECT_EQ(Out, Expected);
+}
+
 } // namespace

>From 9ae5c63b4dcce2637b8f0bcb3d16fe94cfee8969 Mon Sep 17 00:00:00 2001
From: Finn Plummer <canadienf...@gmail.com>
Date: Fri, 6 Jun 2025 19:55:38 +0000
Subject: [PATCH 6/6] clang format

---
 llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp 
b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
index 7e6bbb257a58d..70c3e72c1f806 100644
--- a/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
+++ b/llvm/lib/Frontend/HLSL/HLSLRootSignatureUtils.cpp
@@ -71,9 +71,7 @@ static raw_ostream &operator<<(raw_ostream &OS,
   return OS;
 }
 
-
-static raw_ostream &operator<<(raw_ostream &OS,
-                               const SamplerFilter &Filter) {
+static raw_ostream &operator<<(raw_ostream &OS, const SamplerFilter &Filter) {
   switch (Filter) {
   case SamplerFilter::MinMagMipPoint:
     OS << "MinMagMipPoint";
@@ -243,7 +241,6 @@ static raw_ostream &operator<<(raw_ostream &OS,
   return OS;
 }
 
-
 static raw_ostream &operator<<(raw_ostream &OS,
                                const StaticBorderColor &BorderColor) {
   switch (BorderColor) {
@@ -448,8 +445,7 @@ raw_ostream &operator<<(raw_ostream &OS, const 
RootDescriptor &Descriptor) {
 }
 
 raw_ostream &operator<<(raw_ostream &OS, const StaticSampler &Sampler) {
-  OS << "StaticSampler(" << Sampler.Reg
-     << ", filter = " << Sampler.Filter
+  OS << "StaticSampler(" << Sampler.Reg << ", filter = " << Sampler.Filter
      << ", addressU = " << Sampler.AddressU
      << ", addressV = " << Sampler.AddressV
      << ", addressW = " << Sampler.AddressW
@@ -457,10 +453,8 @@ raw_ostream &operator<<(raw_ostream &OS, const 
StaticSampler &Sampler) {
      << ", maxAnisotropy = " << Sampler.MaxAnisotropy
      << ", comparisonFunc = " << Sampler.CompFunc
      << ", borderColor = " << Sampler.BorderColor
-     << ", minLOD = " << Sampler.MinLOD
-     << ", maxLOD = " << Sampler.MaxLOD
-     << ", space = " << Sampler.Space
-     << ", visibility = " << Sampler.Visibility
+     << ", minLOD = " << Sampler.MinLOD << ", maxLOD = " << Sampler.MaxLOD
+     << ", space = " << Sampler.Space << ", visibility = " << 
Sampler.Visibility
      << ")";
   return OS;
 }

_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to