[Lldb-commits] [PATCH] D123206: [lldb] Silence warnings about unused static variables in RegisterInfos_arm64.h

Martin Storsjö via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 6 04:57:11 PDT 2022


mstorsjo created this revision.
mstorsjo added a reviewer: labath.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
mstorsjo requested review of this revision.
Herald added a project: LLDB.

Move them to the only source file that included RegisterInfos_arm64.h
that actually used these variables.

This silences warnings like these:

  In file included from lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:42:
  lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:790:35: warning: ‘g_register_infos_mte’ defined but not used [-Wunused-variable]
    790 | static lldb_private::RegisterInfo g_register_infos_mte[] = {
        |                                   ^~~~~~~~~~~~~~~~~~~~
  lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h:787:35: warning: ‘g_register_infos_pauth’ defined but not used [-Wunused-variable]
    787 | static lldb_private::RegisterInfo g_register_infos_pauth[] = {
        |                                   ^~~~~~~~~~~~~~~~~~~~~~


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123206

Files:
  lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
  lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h


Index: lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
===================================================================
--- lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
+++ lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h
@@ -784,10 +784,5 @@
     {DEFINE_DBG(wcr, 15)}
 };
 // clang-format on
-static lldb_private::RegisterInfo g_register_infos_pauth[] = {
-    DEFINE_EXTENSION_REG(data_mask), DEFINE_EXTENSION_REG(code_mask)};
-
-static lldb_private::RegisterInfo g_register_infos_mte[] = {
-    DEFINE_EXTENSION_REG(mte_ctrl)};
 
 #endif // DECLARE_REGISTER_INFOS_ARM64_STRUCT
Index: lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
===================================================================
--- lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
@@ -72,6 +72,12 @@
 #include "RegisterInfos_arm64_sve.h"
 #undef DECLARE_REGISTER_INFOS_ARM64_STRUCT
 
+static lldb_private::RegisterInfo g_register_infos_pauth[] = {
+    DEFINE_EXTENSION_REG(data_mask), DEFINE_EXTENSION_REG(code_mask)};
+
+static lldb_private::RegisterInfo g_register_infos_mte[] = {
+    DEFINE_EXTENSION_REG(mte_ctrl)};
+
 // Number of register sets provided by this context.
 enum {
   k_num_gpr_registers = gpr_w28 - gpr_x0 + 1,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123206.420794.patch
Type: text/x-patch
Size: 1343 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220406/7df2dd3c/attachment.bin>


More information about the lldb-commits mailing list