slydiman wrote:

Note `-ffunction-sections -fdata-sections` are added in HandleLLVMOptions.cmake 
and `-Wl,--gc-sections` is added in  AddLLVM.cmake by default. But unused 
functions will be kept anyway if they contain linker gc roots. 
A lot of functions in CPlusPlusLanguage.cpp contain static variables like
```
  static constexpr const char *const libcxx_std_unique_ptr_regex =
      "^std::__[[:alnum:]]+::unique_ptr<.+>$";
```
or
```
lldb::TypeCategoryImplSP CPlusPlusLanguage::GetFormatters() {
  static llvm::once_flag g_initialize;
  static TypeCategoryImplSP g_category;
  ...
}
```
These functions depend on BlockPointer.cpp, BlockPointer.cpp depends on 
TypeSystemClang.cpp, etc.
To avoid changes that may bring the problem back, I suggest to place moved 
functions to a subclass.

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

Reply via email to