[clang] f10b1c5 - [Clang][OpenMP] Fix -Wcovered-switch-default in CGOpenMPRuntime.cpp (NFC)
Jie Fu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 7 05:25:20 PDT 2023
Author: Jie Fu
Date: 2023-06-07T20:23:48+08:00
New Revision: f10b1c5f3cbef76b189566332eebabd017296655
URL: https://github.com/llvm/llvm-project/commit/f10b1c5f3cbef76b189566332eebabd017296655
DIFF: https://github.com/llvm/llvm-project/commit/f10b1c5f3cbef76b189566332eebabd017296655.diff
LOG: [Clang][OpenMP] Fix -Wcovered-switch-default in CGOpenMPRuntime.cpp (NFC)
/data/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1621:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
default:
^
/data/llvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:1643:3: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
default:
^
2 errors generated.
Added:
Modified:
clang/lib/CodeGen/CGOpenMPRuntime.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 6958ed28bffb2..c7d62fc075fbb 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1608,7 +1608,7 @@ convertDeviceClause(const VarDecl *VD) {
if (!DevTy)
return llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseNone;
- switch (*DevTy) {
+ switch ((int)*DevTy) { // Avoid -Wcovered-switch-default
case OMPDeclareTargetDeclAttr::DT_Host:
return llvm::OffloadEntriesInfoManager::OMPTargetDeviceClauseHost;
break;
@@ -1630,7 +1630,7 @@ convertCaptureClause(const VarDecl *VD) {
OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(VD);
if (!MapType)
return llvm::OffloadEntriesInfoManager::OMPTargetGlobalVarEntryNone;
- switch (*MapType) {
+ switch ((int)*MapType) { // Avoid -Wcovered-switch-default
case OMPDeclareTargetDeclAttr::MapTypeTy::MT_To:
return llvm::OffloadEntriesInfoManager::OMPTargetGlobalVarEntryTo;
break;
More information about the cfe-commits
mailing list