https://github.com/JDevlieghere requested changes to this pull request.

I wanted to make this point in #132274, but it fits here as well. I understand 
the need to reduce the binary size of `lldb-server` and I'm totally supportive 
of it. Moving some code around to avoid pulling in some symbols makes sense as 
a proof-of-concept, to show the cost of an unnecessary dependency (e.g. 
lldb-server relies on Debugger which makes the binary 1MB bigger). 

However that approach isn't sustainable. Without a way to enforce this, it is 
going to regress again. Additionally, LLDB developers shouldn't have to have a 
mental model of the transitive dependencies of what lldb-server pulls in. For 
example, I shouldn't have to wonder whether I can use Debugger in FormatEntity, 
who both live in the Core library, because something in `lldb-server` is using 
one but not the other. 

A good example of how to do this is the `NO_PLUGIN_DEPENDENCIES` that 
@bulbazord added to CMake to prevent libraries from introducing new plugin 
dependencies. Although it would be nice, that's not to say that this needs to 
be fully automated. For example, there's nothing (automatically) preventing you 
from introducing a dependency from `Utility` to `Host` but that's still fairly 
easy to spot in a code review. 

It seems like we should address this issue by first fixing the existing 
layering violations, then introducing more layering for `lldb-server` so that 
we bring the granularity to the library level, not the individual object file 
(i.e. source file) level which is too granular. Maybe you have a higher level 
plan to deal with this (and I missed it) and this is a step in that direction? 

https://github.com/llvm/llvm-project/pull/134383
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to