[llvm] 95831f0 - [ARM] Add a default unreachable case to AddrModeToString. NFC

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 10:04:45 PDT 2024


Author: David Green
Date: 2024-09-09T18:04:38+01:00
New Revision: 95831f012d76558fe78f5f3e71b1003a773384e5

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

LOG: [ARM] Add a default unreachable case to AddrModeToString. NFC

Fixes #107739

Added: 
    

Modified: 
    llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h b/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
index 1e87085d7bf07d..88526ba991bec0 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMBaseInfo.h
@@ -211,30 +211,31 @@ namespace ARMII {
 
   inline static const char *AddrModeToString(AddrMode addrmode) {
     switch (addrmode) {
-    case AddrModeNone:    return "AddrModeNone";
-    case AddrMode1:       return "AddrMode1";
-    case AddrMode2:       return "AddrMode2";
-    case AddrMode3:       return "AddrMode3";
-    case AddrMode4:       return "AddrMode4";
-    case AddrMode5:       return "AddrMode5";
-    case AddrMode5FP16:   return "AddrMode5FP16";
-    case AddrMode6:       return "AddrMode6";
-    case AddrModeT1_1:    return "AddrModeT1_1";
-    case AddrModeT1_2:    return "AddrModeT1_2";
-    case AddrModeT1_4:    return "AddrModeT1_4";
-    case AddrModeT1_s:    return "AddrModeT1_s";
-    case AddrModeT2_i12:  return "AddrModeT2_i12";
-    case AddrModeT2_i8:   return "AddrModeT2_i8";
+    default: llvm_unreachable("Unknown addressing mode");
+    case AddrModeNone:     return "AddrModeNone";
+    case AddrMode1:        return "AddrMode1";
+    case AddrMode2:        return "AddrMode2";
+    case AddrMode3:        return "AddrMode3";
+    case AddrMode4:        return "AddrMode4";
+    case AddrMode5:        return "AddrMode5";
+    case AddrMode5FP16:    return "AddrMode5FP16";
+    case AddrMode6:        return "AddrMode6";
+    case AddrModeT1_1:     return "AddrModeT1_1";
+    case AddrModeT1_2:     return "AddrModeT1_2";
+    case AddrModeT1_4:     return "AddrModeT1_4";
+    case AddrModeT1_s:     return "AddrModeT1_s";
+    case AddrModeT2_i12:   return "AddrModeT2_i12";
+    case AddrModeT2_i8:    return "AddrModeT2_i8";
     case AddrModeT2_i8pos: return "AddrModeT2_i8pos";
     case AddrModeT2_i8neg: return "AddrModeT2_i8neg";
-    case AddrModeT2_so:   return "AddrModeT2_so";
-    case AddrModeT2_pc:   return "AddrModeT2_pc";
-    case AddrModeT2_i8s4: return "AddrModeT2_i8s4";
-    case AddrMode_i12:    return "AddrMode_i12";
-    case AddrModeT2_ldrex:return "AddrModeT2_ldrex";
-    case AddrModeT2_i7s4: return "AddrModeT2_i7s4";
-    case AddrModeT2_i7s2: return "AddrModeT2_i7s2";
-    case AddrModeT2_i7:   return "AddrModeT2_i7";
+    case AddrModeT2_so:    return "AddrModeT2_so";
+    case AddrModeT2_pc:    return "AddrModeT2_pc";
+    case AddrModeT2_i8s4:  return "AddrModeT2_i8s4";
+    case AddrMode_i12:     return "AddrMode_i12";
+    case AddrModeT2_ldrex: return "AddrModeT2_ldrex";
+    case AddrModeT2_i7s4:  return "AddrModeT2_i7s4";
+    case AddrModeT2_i7s2:  return "AddrModeT2_i7s2";
+    case AddrModeT2_i7:    return "AddrModeT2_i7";
     }
   }
 


        


More information about the llvm-commits mailing list