[lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)
authorJie Fu <jiefu@tencent.com>
Fri, 21 Jul 2023 03:41:28 +0000 (11:41 +0800)
committerJie Fu <jiefu@tencent.com>
Fri, 21 Jul 2023 03:42:42 +0000 (11:42 +0800)
/data/llvm-project/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp:319:1: error: non-void function does
not return a value in all control paths [-Werror,-Wreturn-type]
}
^
1 error generated.

lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp

index a894dfe..7b2d64d 100644 (file)
@@ -238,7 +238,7 @@ uint32_t RegisterInfos_x86_64_with_base_shared::g_invalidate_st7_64[] = {
 RegInfo &GetRegInfoShared(llvm::Triple::ArchType arch_type, bool with_base) {
   static std::once_flag once_flag_x86, once_flag_x86_64,
       once_flag_x86_64_with_base;
-  static RegInfo reg_info_x86, reg_info_x86_64, reg_info_x86_64_with_base;
+  static RegInfo reg_info_x86, reg_info_x86_64, reg_info_x86_64_with_base, reg_info_invalid;
 
   switch (arch_type) {
   case llvm::Triple::x86:
@@ -314,7 +314,7 @@ RegInfo &GetRegInfoShared(llvm::Triple::ArchType arch_type, bool with_base) {
     }
   default:
     assert(false && "Unhandled target architecture.");
-    break;
+    return reg_info_invalid;
   }
 }