From 1ab9a2906e19cca87cafac25cc31231a36de4843 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 5 Nov 2021 23:08:27 -0700 Subject: [PATCH] [lldb] Fix C2360: initialization of 'identifier' is skipped by 'case' label Make sure that every case has its own lexical block. --- .../Plugins/Platform/MacOSX/PlatformDarwin.cpp | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index bbf6be6..995b070 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -592,52 +592,59 @@ static llvm::ArrayRef 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 GetCompatibleArchs(ArchSpec::Core core) { }; return {g_armv4_compatible_archs}; } + } return {}; } -- 2.7.4