[llvm] ad1b7a4 - Fix a warning: default label in switch which covers all enumeration values (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 21:11:15 PDT 2023


Author: Mehdi Amini
Date: 2023-10-31T21:10:54-07:00
New Revision: ad1b7a47486545c669c0a4fe25f2e2d5d0e7530b

URL: https://github.com/llvm/llvm-project/commit/ad1b7a47486545c669c0a4fe25f2e2d5d0e7530b
DIFF: https://github.com/llvm/llvm-project/commit/ad1b7a47486545c669c0a4fe25f2e2d5d0e7530b.diff

LOG: Fix a warning: default label in switch which covers all enumeration values (NFC)

Added: 
    

Modified: 
    llvm/lib/Target/TargetMachineC.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/TargetMachineC.cpp b/llvm/lib/Target/TargetMachineC.cpp
index f6ed26be575595a..80024f9a6d5df58 100644
--- a/llvm/lib/Target/TargetMachineC.cpp
+++ b/llvm/lib/Target/TargetMachineC.cpp
@@ -262,7 +262,7 @@ void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable) {
 
 void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
                                          LLVMGlobalISelAbortMode Mode) {
-  GlobalISelAbortMode AM;
+  GlobalISelAbortMode AM = GlobalISelAbortMode::Enable;
   switch (Mode) {
   case LLVMGlobalISelAbortDisable:
     AM = GlobalISelAbortMode::Disable;
@@ -273,9 +273,6 @@ void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
   case LLVMGlobalISelAbortDisableWithDiag:
     AM = GlobalISelAbortMode::DisableWithDiag;
     break;
-  default:
-    AM = GlobalISelAbortMode::Enable;
-    break;
   }
 
   unwrap(T)->setGlobalISelAbort(AM);


        


More information about the llvm-commits mailing list