[llvm] [SPIRV] Fix sanitizer-x86_64-linux-android/8085 (PR #135189)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 07:36:28 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-spir-v

Author: Steven Perron (s-perron)

<details>
<summary>Changes</summary>

The build failed because the cases covered all possibilities, so the
default was not needed. I have removed the default case, and placed the
llvm_unreachable after the switch.

https://lab.llvm.org/buildbot/#/builders/186/builds/8085


---
Full diff: https://github.com/llvm/llvm-project/pull/135189.diff


1 Files Affected:

- (modified) llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp (+2-3) 


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

``````````

</details>


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


More information about the llvm-commits mailing list