[clang] 3a671c8 - [NFC] use llvm_unreachable instead of return on switch which all cases are covered.
Xiang Li via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 17 17:49:32 PDT 2022
Author: Xiang Li
Date: 2022-10-17T17:47:48-07:00
New Revision: 3a671c8e91c04a3288357f088adcd364a6cd6b22
URL: https://github.com/llvm/llvm-project/commit/3a671c8e91c04a3288357f088adcd364a6cd6b22
DIFF: https://github.com/llvm/llvm-project/commit/3a671c8e91c04a3288357f088adcd364a6cd6b22.diff
LOG: [NFC] use llvm_unreachable instead of return on switch which all cases are covered.
Added:
Modified:
clang/lib/CodeGen/CGHLSLRuntime.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index 6f32136b49de..cfdc1f68a03d 100644
--- a/clang/lib/CodeGen/CGHLSLRuntime.cpp
+++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp
@@ -270,7 +270,7 @@ castResourceShapeToResourceKind(HLSLResourceAttr::ResourceKind RK) {
static_cast<uint32_t>(
HLSLResourceAttr::ResourceKind::FeedbackTexture2DArray) ==
(static_cast<uint32_t>(llvm::hlsl::ResourceKind::NumEntries) - 2));
- return llvm::hlsl::ResourceKind::Invalid;
+ llvm_unreachable("all switch cases should be covered");
}
void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) {
More information about the cfe-commits
mailing list