[llvm] c3eb6b7 - SPIRV: Suppress warnings in #134429

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 11 00:08:51 PDT 2025


Author: NAKAMURA Takumi
Date: 2025-04-11T16:08:03+09:00
New Revision: c3eb6b7e61356aca7ffbcaf962544d3d8fb3713d

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

LOG: SPIRV: Suppress warnings in #134429

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 cc01a6d0bac23..4ce316ea32e1c 100644
--- a/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
@@ -54,6 +54,7 @@ static unsigned typeToAddressSpace(const Type *Ty) {
   report_fatal_error("Unable to convert LLVM type to SPIRVType", true);
 }
 
+#ifndef NDEBUG
 static bool
 storageClassRequiresExplictLayout(SPIRV::StorageClass::StorageClass SC) {
   switch (SC) {
@@ -85,6 +86,7 @@ storageClassRequiresExplictLayout(SPIRV::StorageClass::StorageClass SC) {
   }
   llvm_unreachable("Unknown SPIRV::StorageClass enum");
 }
+#endif
 
 SPIRVGlobalRegistry::SPIRVGlobalRegistry(unsigned PointerSize)
     : PointerSize(PointerSize), Bound(0) {}
@@ -1741,7 +1743,8 @@ SPIRVType *SPIRVGlobalRegistry::getOrCreateSPIRVPointerType(
 
 SPIRVType *SPIRVGlobalRegistry::changePointerStorageClass(
     SPIRVType *PtrType, SPIRV::StorageClass::StorageClass SC, MachineInstr &I) {
-  SPIRV::StorageClass::StorageClass OldSC = getPointerStorageClass(PtrType);
+  [[maybe_unused]] SPIRV::StorageClass::StorageClass OldSC =
+      getPointerStorageClass(PtrType);
   assert(storageClassRequiresExplictLayout(OldSC) ==
          storageClassRequiresExplictLayout(SC));
 


        


More information about the llvm-commits mailing list