Skip to content

Commit 18f667d

Browse files
committed
Revert "[lldb/cmake] Plugin layering enforcement mechanism (#144543)"
Causes failures on several bots. This reverts commits 714b2fd and e7c1da7.
1 parent b1b8f67 commit 18f667d

File tree

32 files changed

+0
-219
lines changed

32 files changed

+0
-219
lines changed

lldb/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ endif()
3737

3838
include(LLDBConfig)
3939
include(AddLLDB)
40-
include(LLDBLayeringCheck)
4140

4241
set(LLDB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
4342

@@ -128,8 +127,6 @@ add_subdirectory(source)
128127
add_subdirectory(tools)
129128
add_subdirectory(docs)
130129

131-
check_lldb_plugin_layering()
132-
133130
if (LLDB_ENABLE_PYTHON)
134131
if(LLDB_BUILD_FRAMEWORK)
135132
set(lldb_python_target_dir "${LLDB_FRAMEWORK_ABSOLUTE_BUILD_DIR}/LLDB.framework/Resources/Python/lldb")

lldb/cmake/modules/LLDBLayeringCheck.cmake

Lines changed: 0 additions & 74 deletions
This file was deleted.

lldb/docs/resources/contributing.rst

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -56,56 +56,6 @@ subset of LLDB tests (the API tests) use a different system. Refer to the
5656
`lldb/test <https://github.com/llvm/llvm-project/tree/main/lldb/test>`_ folder
5757
for examples.
5858

59-
60-
LLDB plugins and their dependencies
61-
-----------------------------------
62-
63-
LLDB has a concept of *plugins*, which are used to provide abstraction
64-
boundaries over functionality that is specific to a certain architecture,
65-
operating system, programming language, etc. A plugin implements an abstract
66-
base class (rarely, a set of related base classes), which is a part of LLDB
67-
core. This setup allows the LLDB core to remain generic while making it possible
68-
to support for new architectures, languages, and so on. For this to work, all
69-
code needs to obey certain rules.
70-
71-
The principal rule is that LLDB core (defined as: everything under lldb/source
72-
*minus* lldb/source/Plugins) must not depend on any specific plugin. The only
73-
way it can interact with them is through the abstract interface. Explicit
74-
dependencies such as casting the base class to the plugin type are not permitted
75-
and neither are more subtle dependencies like checking the name plugin or or
76-
other situations where some code in LLDB core is tightly coupled to the
77-
implementation details of a specific plugin.
78-
79-
The rule for interaction between different plugins is more nuanced. We recognize
80-
that some cross-plugin dependencies are unavoidable or even desirable. For
81-
example, a plugin may want to extend a plugin of the same kind to
82-
add/override/refine some functionality (e.g., Android is a "kind of" Linux, but
83-
it handles some things differently). Alternatively, a plugin of one kind may
84-
want to build on the functionality offered by a specific plugin of another kind
85-
(ELFCore Process plugin uses ELF ObjectFile plugin to create a process out of an
86-
ELF core file).
87-
88-
In cases such as these, direct dependencies are acceptable. However, to keep the
89-
dependency graph manageable, we still have some rules to govern these
90-
relationships:
91-
92-
* All dependencies between plugins of the same kind must flow in the same
93-
direction (if plugin `A1` depends on plugin `B1`, then `B2` must not depend on
94-
`A2`)
95-
* Dependency graph of plugin kinds must not contain loops (dependencies like
96-
`A1->B1`, `B2->C2` and `C3->A3` are forbidden because they induce a cycle in
97-
the plugin kind graph even though the plugins themselves are acyclical)
98-
99-
100-
The first of these rules is checked via CMake scripts (using the
101-
`LLDB_ACCEPTABLE_PLUGIN_DEPENDENCIES` property). Dependencies in this category
102-
are expected and permitted (subject to other constraints such as that dependency
103-
making sense for the particular pair of plugins). Unfortunately, due to historic
104-
reasons, not all plugin dependencies follow this rule, which is why we have
105-
another category called `LLDB_TOLERATED_PLUGIN_DEPENDENCIES`. New dependencies
106-
are forbidden (even though they are accepted by CMake) and existing ones should
107-
be removed whereever possible.
108-
10959
.. _Error handling:
11060

11161
Error handling and use of assertions in LLDB

lldb/source/Plugins/ABI/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND ABI)
2-
set_property(DIRECTORY PROPERTY LLDB_TOLERATED_PLUGIN_DEPENDENCIES
3-
ProcessUtility
4-
TypeSystem
5-
)
6-
71
foreach(target AArch64 ARM ARC Hexagon LoongArch Mips MSP430 PowerPC RISCV SystemZ X86)
82
if (${target} IN_LIST LLVM_TARGETS_TO_BUILD)
93
add_subdirectory(${target})

lldb/source/Plugins/Architecture/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND Architecture)
2-
31
add_subdirectory(Arm)
42
add_subdirectory(Mips)
53
add_subdirectory(PPC64)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND Disassembler)
2-
31
add_subdirectory(LLVMC)

lldb/source/Plugins/DynamicLoader/CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND DynamicLoader)
2-
set_property(DIRECTORY PROPERTY LLDB_ACCEPTABLE_PLUGIN_DEPENDENCIES ObjectFile)
3-
set_property(DIRECTORY PROPERTY LLDB_TOLERATED_PLUGIN_DEPENDENCIES
4-
Process # part of a loop (Process<->DynamicLoader).
5-
TypeSystem
6-
)
7-
81
add_subdirectory(Darwin-Kernel)
92
add_subdirectory(FreeBSD-Kernel)
103
add_subdirectory(MacOSX-DYLD)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND ExpressionParser)
2-
31
add_subdirectory(Clang)

lldb/source/Plugins/Instruction/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND Instruction)
2-
31
add_subdirectory(ARM)
42
add_subdirectory(ARM64)
53
add_subdirectory(LoongArch)

lldb/source/Plugins/InstrumentationRuntime/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
set_property(DIRECTORY PROPERTY LLDB_PLUGIN_KIND InstrumentationRuntime)
2-
31
add_subdirectory(ASan)
42
add_subdirectory(ASanLibsanitizers)
53
add_subdirectory(MainThreadChecker)

0 commit comments

Comments
 (0)