Skip to content

Conversation

@s-perron
Copy link
Contributor

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

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
@llvmbot
Copy link
Member

llvmbot commented Apr 10, 2025

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

Author: Steven Perron (s-perron)

Changes

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 --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)

@s-perron
Copy link
Contributor Author

Someone else got their fix merged first: 83f831d.

@s-perron s-perron closed this Apr 10, 2025
@s-perron s-perron deleted the fix_switch branch April 10, 2025 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants