[NFC] use llvm_unreachable instead of return on switch which all cases are covered.
authorXiang Li <python3kgae@outlook.com>
Tue, 18 Oct 2022 00:47:48 +0000 (17:47 -0700)
committerXiang Li <python3kgae@outlook.com>
Tue, 18 Oct 2022 00:47:48 +0000 (17:47 -0700)
clang/lib/CodeGen/CGHLSLRuntime.cpp

index 6f32136..cfdc1f6 100644 (file)
@@ -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) {