[Lldb-commits] [lldb] 8a45a54 - [lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)

Jie Fu via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 20 20:42:50 PDT 2023


Author: Jie Fu
Date: 2023-07-21T11:42:42+08:00
New Revision: 8a45a54d59fcd29f559f4f260e2c447bef498e1e

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

LOG: [lldb] Fix -Wreturn-type in RegisterInfos_x86_64_with_base_shared.cpp (NFC)

/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.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
index a894dfe6143c41..7b2d64de230f33 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64_with_base_shared.cpp
@@ -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;
   }
 }
 


        


More information about the lldb-commits mailing list