[llvm] [DXIL] Add support for root signature flag element in DXContainer (PR #123147)

Justin Bogner via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 11 13:03:02 PST 2025


================
@@ -57,24 +57,13 @@ static bool parseRootSignatureElement(LLVMContext *Ctx,
   RootSignatureElementKind ElementKind =
       StringSwitch<RootSignatureElementKind>(ElementText->getString())
           .Case("RootFlags", RootSignatureElementKind::RootFlags)
-          .Case("RootConstants", RootSignatureElementKind::RootConstants)
-          .Case("RootCBV", RootSignatureElementKind::RootDescriptor)
-          .Case("RootSRV", RootSignatureElementKind::RootDescriptor)
-          .Case("RootUAV", RootSignatureElementKind::RootDescriptor)
-          .Case("Sampler", RootSignatureElementKind::RootDescriptor)
-          .Case("DescriptorTable", RootSignatureElementKind::DescriptorTable)
-          .Case("StaticSampler", RootSignatureElementKind::StaticSampler)
           .Default(RootSignatureElementKind::None);
 
   switch (ElementKind) {
 
   case RootSignatureElementKind::RootFlags:
     return parseRootFlags(Ctx, MRS, Element);
-  case RootSignatureElementKind::RootConstants:
-  case RootSignatureElementKind::RootDescriptor:
-  case RootSignatureElementKind::DescriptorTable:
-  case RootSignatureElementKind::StaticSampler:
-  case RootSignatureElementKind::None:
+  default:
     return reportError(Ctx,
                        "Invalid Root Element: " + ElementText->getString());
----------------
bogner wrote:

This switch statement is fully covered - we shouldn't need a default case here at all.

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


More information about the llvm-commits mailing list