JDevlieghere created this revision.
JDevlieghere added a reviewer: labath.
Herald added subscribers: jsji, abidh, atanasyan, mgorny, nemanjai, sdardis.
Herald added a project: LLDB.

After the recent change that grouped some of the ABI plugins together, those 
plugins ended up with multiple initializers per plugin. This is incompatible 
with my proposed approach of generating the initializers dynamically, which is 
why I've grouped them together in a new entry point.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D74451

Files:
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Plugins/ABI/AArch64/AArch64.cpp
  lldb/source/Plugins/ABI/AArch64/AArch64.h
  lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
  lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
  lldb/source/Plugins/ABI/ARM/ARM.cpp
  lldb/source/Plugins/ABI/ARM/ARM.h
  lldb/source/Plugins/ABI/ARM/CMakeLists.txt
  lldb/source/Plugins/ABI/Mips/CMakeLists.txt
  lldb/source/Plugins/ABI/Mips/Mips.cpp
  lldb/source/Plugins/ABI/Mips/Mips.h
  lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
  lldb/source/Plugins/ABI/PowerPC/PowerPC.cpp
  lldb/source/Plugins/ABI/PowerPC/PowerPC.h
  lldb/source/Plugins/ABI/X86/CMakeLists.txt
  lldb/source/Plugins/ABI/X86/X86.cpp
  lldb/source/Plugins/ABI/X86/X86.h

Index: lldb/source/Plugins/ABI/X86/X86.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/X86/X86.h
@@ -0,0 +1,17 @@
+//===-- X86.h ---------------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ABIX86_h_
+#define liblldb_ABIX86_h_
+
+class ABIX86 {
+public:
+  static void Initialize();
+  static void Terminate();
+};
+#endif
Index: lldb/source/Plugins/ABI/X86/X86.cpp
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/X86/X86.cpp
@@ -0,0 +1,30 @@
+//===-- X86.h -------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "X86.h"
+#include "ABIMacOSX_i386.h"
+#include "ABISysV_i386.h"
+#include "ABISysV_x86_64.h"
+#include "ABIWindows_x86_64.h"
+#include "lldb/Core/PluginManager.h"
+
+LLDB_PLUGIN(ABIX86)
+
+void ABIX86::Initialize() {
+  ABIMacOSX_i386::Initialize();
+  ABISysV_i386::Initialize();
+  ABISysV_x86_64::Initialize();
+  ABIWindows_x86_64::Initialize();
+}
+
+void ABIX86::Terminate() {
+  ABIMacOSX_i386::Terminate();
+  ABISysV_i386::Terminate();
+  ABISysV_x86_64::Terminate();
+  ABIWindows_x86_64::Terminate();
+}
Index: lldb/source/Plugins/ABI/X86/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ABI/X86/CMakeLists.txt
+++ lldb/source/Plugins/ABI/X86/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_library(lldbPluginABIX86 PLUGIN
+  X86.cpp
   ABIMacOSX_i386.cpp
   ABISysV_i386.cpp
   ABISysV_x86_64.cpp
Index: lldb/source/Plugins/ABI/PowerPC/PowerPC.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/PowerPC/PowerPC.h
@@ -0,0 +1,17 @@
+//===-- PowerPC.h -----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ABIPowerPC_h_
+#define liblldb_ABIPowerPC_h_
+
+class ABIPowerPC {
+public:
+  static void Initialize();
+  static void Terminate();
+};
+#endif
Index: lldb/source/Plugins/ABI/PowerPC/PowerPC.cpp
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/PowerPC/PowerPC.cpp
@@ -0,0 +1,24 @@
+//===-- PowerPC.h ---------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "PowerPC.h"
+#include "ABISysV_ppc.h"
+#include "ABISysV_ppc64.h"
+#include "lldb/Core/PluginManager.h"
+
+LLDB_PLUGIN(ABIPowerPC)
+
+void ABIPowerPC::Initialize() {
+  ABISysV_ppc::Initialize();
+  ABISysV_ppc64::Initialize();
+}
+
+void ABIPowerPC::Terminate() {
+  ABISysV_ppc::Terminate();
+  ABISysV_ppc64::Terminate();
+}
Index: lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
+++ lldb/source/Plugins/ABI/PowerPC/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_library(lldbPluginABIPowerPC PLUGIN
+  PowerPC.cpp
   ABISysV_ppc.cpp
   ABISysV_ppc64.cpp
 
Index: lldb/source/Plugins/ABI/Mips/Mips.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/Mips/Mips.h
@@ -0,0 +1,17 @@
+//===-- Mips.h -----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ABIMips_h_
+#define liblldb_ABIMips_h_
+
+class ABIMips {
+public:
+  static void Initialize();
+  static void Terminate();
+};
+#endif
Index: lldb/source/Plugins/ABI/Mips/Mips.cpp
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/Mips/Mips.cpp
@@ -0,0 +1,24 @@
+//===-- Mips.h ------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "Mips.h"
+#include "ABISysV_mips.h"
+#include "ABISysV_mips64.h"
+#include "lldb/Core/PluginManager.h"
+
+LLDB_PLUGIN(ABIMips)
+
+void ABIMips::Initialize() {
+  ABISysV_mips::Initialize();
+  ABISysV_mips64::Initialize();
+}
+
+void ABIMips::Terminate() {
+  ABISysV_mips::Terminate();
+  ABISysV_mips64::Terminate();
+}
Index: lldb/source/Plugins/ABI/Mips/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ABI/Mips/CMakeLists.txt
+++ lldb/source/Plugins/ABI/Mips/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_library(lldbPluginABIMips PLUGIN
+  Mips.cpp
   ABISysV_mips.cpp
   ABISysV_mips64.cpp
 
Index: lldb/source/Plugins/ABI/ARM/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ABI/ARM/CMakeLists.txt
+++ lldb/source/Plugins/ABI/ARM/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_library(lldbPluginABIARM PLUGIN
+  ARM.cpp
   ABIMacOSX_arm.cpp
   ABISysV_arm.cpp
 
Index: lldb/source/Plugins/ABI/ARM/ARM.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/ARM/ARM.h
@@ -0,0 +1,17 @@
+//===-- ARM.h -------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ABIARM_h_
+#define liblldb_ABIARM_h_
+
+class ABIARM {
+public:
+  static void Initialize();
+  static void Terminate();
+};
+#endif
Index: lldb/source/Plugins/ABI/ARM/ARM.cpp
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/ARM/ARM.cpp
@@ -0,0 +1,24 @@
+//===-- ARM.h -------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "ARM.h"
+#include "ABIMacOSX_arm.h"
+#include "ABISysV_arm.h"
+#include "lldb/Core/PluginManager.h"
+
+LLDB_PLUGIN(ABIARM)
+
+void ABIARM::Initialize() {
+  ABISysV_arm::Initialize();
+  ABIMacOSX_arm::Initialize();
+}
+
+void ABIARM::Terminate() {
+  ABISysV_arm::Terminate();
+  ABIMacOSX_arm::Terminate();
+}
Index: lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
===================================================================
--- lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
+++ lldb/source/Plugins/ABI/AArch64/CMakeLists.txt
@@ -1,4 +1,5 @@
 add_lldb_library(lldbPluginABIAArch64 PLUGIN
+  AArch64.cpp
   ABIMacOSX_arm64.cpp
   ABISysV_arm64.cpp
 
Index: lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
===================================================================
--- lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
+++ lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
@@ -33,8 +33,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN(ABISysV_arm64)
-
 static RegisterInfo g_register_infos[] = {
     //  NAME       ALT       SZ OFF ENCODING          FORMAT
     //  EH_FRAME             DWARF                  GENERIC
Index: lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
===================================================================
--- lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
+++ lldb/source/Plugins/ABI/AArch64/ABIMacOSX_arm64.cpp
@@ -33,8 +33,6 @@
 using namespace lldb;
 using namespace lldb_private;
 
-LLDB_PLUGIN(ABIMacOSX_arm64)
-
 static const char *pluginDesc = "Mac OS X ABI for arm64 targets";
 
 static RegisterInfo g_register_infos[] = {
Index: lldb/source/Plugins/ABI/AArch64/AArch64.h
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/AArch64/AArch64.h
@@ -0,0 +1,17 @@
+//===-- AArch64.h -----------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_ABIAArch64_h_
+#define liblldb_ABIAArch64_h_
+
+class ABIAArch64 {
+public:
+  static void Initialize();
+  static void Terminate();
+};
+#endif
Index: lldb/source/Plugins/ABI/AArch64/AArch64.cpp
===================================================================
--- /dev/null
+++ lldb/source/Plugins/ABI/AArch64/AArch64.cpp
@@ -0,0 +1,24 @@
+//===-- AArch64.h ---------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "AArch64.h"
+#include "ABIMacOSX_arm64.h"
+#include "ABISysV_arm64.h"
+#include "lldb/Core/PluginManager.h"
+
+LLDB_PLUGIN(ABIAArch64)
+
+void ABIAArch64::Initialize() {
+  ABISysV_arm64::Initialize();
+  ABIMacOSX_arm64::Initialize();
+}
+
+void ABIAArch64::Terminate() {
+  ABISysV_arm64::Terminate();
+  ABIMacOSX_arm64::Terminate();
+}
Index: lldb/source/API/SystemInitializerFull.cpp
===================================================================
--- lldb/source/API/SystemInitializerFull.cpp
+++ lldb/source/API/SystemInitializerFull.cpp
@@ -24,21 +24,14 @@
 
 #include <string>
 
-LLDB_PLUGIN_DECLARE(ABIMacOSX_arm64);
-LLDB_PLUGIN_DECLARE(ABISysV_arm64);
-LLDB_PLUGIN_DECLARE(ABIMacOSX_arm);
-LLDB_PLUGIN_DECLARE(ABISysV_arm);
+LLDB_PLUGIN_DECLARE(ABIAArch64);
+LLDB_PLUGIN_DECLARE(ABIARM);
 LLDB_PLUGIN_DECLARE(ABISysV_arc);
 LLDB_PLUGIN_DECLARE(ABISysV_hexagon);
-LLDB_PLUGIN_DECLARE(ABISysV_mips);
-LLDB_PLUGIN_DECLARE(ABISysV_mips64);
-LLDB_PLUGIN_DECLARE(ABISysV_ppc);
-LLDB_PLUGIN_DECLARE(ABISysV_ppc64);
+LLDB_PLUGIN_DECLARE(ABIMips);
+LLDB_PLUGIN_DECLARE(ABIPowerPC);
 LLDB_PLUGIN_DECLARE(ABISysV_s390x);
-LLDB_PLUGIN_DECLARE(ABIMacOSX_i386);
-LLDB_PLUGIN_DECLARE(ABISysV_i386);
-LLDB_PLUGIN_DECLARE(ABISysV_x86_64);
-LLDB_PLUGIN_DECLARE(ABIWindows_x86_64);
+LLDB_PLUGIN_DECLARE(ABIX86);
 LLDB_PLUGIN_DECLARE(ObjectFileBreakpad);
 LLDB_PLUGIN_DECLARE(ObjectFileELF);
 LLDB_PLUGIN_DECLARE(ObjectFileMachO);
@@ -122,26 +115,14 @@
 
 SystemInitializerFull::~SystemInitializerFull() {}
 
-#define LLDB_PROCESS_AArch64(op)                                               \
-  op(ABIMacOSX_arm64);                                                         \
-  op(ABISysV_arm64);
-#define LLDB_PROCESS_ARM(op)                                                   \
-  op(ABIMacOSX_arm);                                                           \
-  op(ABISysV_arm);
+#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
+#define LLDB_PROCESS_ARM(op) op(ABIARM);
 #define LLDB_PROCESS_ARC(op) op(ABISysV_arc);
 #define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon);
-#define LLDB_PROCESS_Mips(op)                                                  \
-  op(ABISysV_mips);                                                            \
-  op(ABISysV_mips64);
-#define LLDB_PROCESS_PowerPC(op)                                               \
-  op(ABISysV_ppc);                                                             \
-  op(ABISysV_ppc64);
+#define LLDB_PROCESS_Mips(op) op(ABIMips);
+#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
 #define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x);
-#define LLDB_PROCESS_X86(op)                                                   \
-  op(ABIMacOSX_i386);                                                          \
-  op(ABISysV_i386);                                                            \
-  op(ABISysV_x86_64);                                                          \
-  op(ABIWindows_x86_64);
+#define LLDB_PROCESS_X86(op) op(ABIX86);
 
 #define LLDB_PROCESS_AMDGPU(op)
 #define LLDB_PROCESS_AVR(op)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to