[llvm] [DirectX][NFC] Refactoring DirectX backend to not use `llvm::to_underlying` in switch cases. (PR #151032)

Finn Plummer via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 28 13:48:00 PDT 2025


================
@@ -53,10 +53,9 @@ bool verifyRootDescriptorFlag(uint32_t Version, uint32_t FlagsVal) {
 
 bool verifyRangeType(uint32_t Type) {
   switch (Type) {
-  case llvm::to_underlying(dxbc::DescriptorRangeType::CBV):
-  case llvm::to_underlying(dxbc::DescriptorRangeType::SRV):
-  case llvm::to_underlying(dxbc::DescriptorRangeType::UAV):
-  case llvm::to_underlying(dxbc::DescriptorRangeType::Sampler):
+#define DESCRIPTOR_RANGE(Num, Val)                                             \
+  case llvm::to_underlying(dxbc::DescriptorRangeType::Val):
+#include "llvm/BinaryFormat/DXContainerConstants.def"
----------------
inbelic wrote:

This is not updating to not use `to_underlying`

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


More information about the llvm-commits mailing list