[Lldb-commits] [lldb] [LLDB][NFC] Move CPlusPlusLanguage methods used in Core/Module.cpp to a separated module to break lldb-server dependencies (PR #132274)

Dmitry Vasilyev via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 27 11:08:35 PDT 2025


slydiman wrote:

@labath 
The repro above shows that CPlusPlusLanguage::GetHardcodedSummaries() causes to link TypeSystemClang  and other dependencies. But --print-gc-sections and `llvm-objdump --all-headers --demangle lldb-server` shows that GetHardcodedSummaries is missing in the final binary. The linker removes unused functions like GetHardcodedSummaries, but the dependencies are linked because of global variables like TypeSystemClang::ID.

So, this patch solves the specific issue by breaking the dependency chain. 
Or we should refactor all global variables in all dependencies (lldb, llvm, clang). 
Note we have found at least 90 extra gc roots.

https://github.com/llvm/llvm-project/pull/132274


More information about the lldb-commits mailing list