[llvm] 83f831d - Fix-forward -Wcovered-switch-default error in #134429

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 08:58:03 PDT 2025


Author: Thurston Dang
Date: 2025-04-10T15:56:33Z
New Revision: 83f831d46f46e9f68bec9b7a6592f678c8ba61ab

URL: https://github.com/llvm/llvm-project/commit/83f831d46f46e9f68bec9b7a6592f678c8ba61ab
DIFF: https://github.com/llvm/llvm-project/commit/83f831d46f46e9f68bec9b7a6592f678c8ba61ab.diff

LOG: Fix-forward -Wcovered-switch-default error in #134429

Remove the default case to avoid buildbot error (https://lab.llvm.org/buildbot/#/builders/66/builds/12382/steps/8/logs/stdio):
```
/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp:85:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
   85 |   default:
      |   ^
```

(also https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations)

Added: 
    

Modified: 
    llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
index 8351c5f2def66..1858b9e118c00 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
@@ -82,9 +82,6 @@ storageClassRequiresExplictLayout(SPIRV::StorageClass::StorageClass SC) {
   case SPIRV::StorageClass::DeviceOnlyINTEL:
   case SPIRV::StorageClass::HostOnlyINTEL:
     return false;
-  default:
-    llvm_unreachable("Unknown storage class");
-    return false;
   }
 }
 


        


More information about the llvm-commits mailing list