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

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 07:35:48 PDT 2025


https://github.com/s-perron created https://github.com/llvm/llvm-project/pull/135189

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


>From 3752539b04a686e5e94692716afc7fdcb239e469 Mon Sep 17 00:00:00 2001
From: Steven Perron <stevenperron at google.com>
Date: Thu, 10 Apr 2025 10:30:18 -0400
Subject: [PATCH] [SPIRV] Fix sanitizer-x86_64-linux-android/8085

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
---
 llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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)



More information about the llvm-commits mailing list