[Lldb-commits] [lldb] 1ab9a29 - [lldb] Fix C2360: initialization of 'identifier' is skipped by 'case' label

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 5 23:09:41 PDT 2021


Author: Jonas Devlieghere
Date: 2021-11-05T23:09:35-07:00
New Revision: 1ab9a2906e19cca87cafac25cc31231a36de4843

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

LOG: [lldb] Fix C2360: initialization of 'identifier' is skipped by 'case' label

Make sure that every case has its own lexical block.

Added: 
    

Modified: 
    lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index bbf6be6468233..995b0703bc459 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -592,52 +592,59 @@ static llvm::ArrayRef<const char *> GetCompatibleArchs(ArchSpec::Core core) {
     };
     return {g_armv7f_compatible_archs};
   }
-  case ArchSpec::eCore_arm_armv7k:
+  case ArchSpec::eCore_arm_armv7k: {
     static const char *g_armv7k_compatible_archs[] = {
         "armv7k",  "armv7",   "armv6m",   "armv6",   "armv5",
         "armv4",   "arm",     "thumbv7k", "thumbv7", "thumbv6m",
         "thumbv6", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv7k_compatible_archs};
-  case ArchSpec::eCore_arm_armv7s:
+  }
+  case ArchSpec::eCore_arm_armv7s: {
     static const char *g_armv7s_compatible_archs[] = {
         "armv7s",  "armv7",   "armv6m",   "armv6",   "armv5",
         "armv4",   "arm",     "thumbv7s", "thumbv7", "thumbv6m",
         "thumbv6", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv7s_compatible_archs};
-  case ArchSpec::eCore_arm_armv7m:
+  }
+  case ArchSpec::eCore_arm_armv7m: {
     static const char *g_armv7m_compatible_archs[] = {
         "armv7m",  "armv7",   "armv6m",   "armv6",   "armv5",
         "armv4",   "arm",     "thumbv7m", "thumbv7", "thumbv6m",
         "thumbv6", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv7m_compatible_archs};
-  case ArchSpec::eCore_arm_armv7em:
+  }
+  case ArchSpec::eCore_arm_armv7em: {
     static const char *g_armv7em_compatible_archs[] = {
         "armv7em", "armv7",   "armv6m",    "armv6",   "armv5",
         "armv4",   "arm",     "thumbv7em", "thumbv7", "thumbv6m",
         "thumbv6", "thumbv5", "thumbv4t",  "thumb",
     };
     return {g_armv7em_compatible_archs};
-  case ArchSpec::eCore_arm_armv6m:
+  }
+  case ArchSpec::eCore_arm_armv6m: {
     static const char *g_armv6m_compatible_archs[] = {
         "armv6m",   "armv6",   "armv5",   "armv4",    "arm",
         "thumbv6m", "thumbv6", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv6m_compatible_archs};
-  case ArchSpec::eCore_arm_armv6:
+  }
+  case ArchSpec::eCore_arm_armv6: {
     static const char *g_armv6_compatible_archs[] = {
         "armv6",   "armv5",   "armv4",    "arm",
         "thumbv6", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv6_compatible_archs};
-  case ArchSpec::eCore_arm_armv5:
+  }
+  case ArchSpec::eCore_arm_armv5: {
     static const char *g_armv5_compatible_archs[] = {
         "armv5", "armv4", "arm", "thumbv5", "thumbv4t", "thumb",
     };
     return {g_armv5_compatible_archs};
-  case ArchSpec::eCore_arm_armv4:
+  }
+  case ArchSpec::eCore_arm_armv4: {
     static const char *g_armv4_compatible_archs[] = {
         "armv4",
         "arm",
@@ -646,6 +653,7 @@ static llvm::ArrayRef<const char *> GetCompatibleArchs(ArchSpec::Core core) {
     };
     return {g_armv4_compatible_archs};
   }
+  }
   return {};
 }
 


        


More information about the lldb-commits mailing list