Open akbyrd opened 6 months ago
For a data point, removing all private class methods drops the symbol count to around 42k.
# Skip private class methods
elif re.search("@[A-F].*@Z$", symbol):
return None
This is unlikely to be shippable, since I assume a function from clang that calls a private class method could be inlined into a plugin module. At that point it would presumably need to link against the symbol.
But it's still interesting from the perspective of just how much is being exported that in theory shouldn't be. I imagine the ideal solution here is to explicitly declare which functions are expected to be exported. Something akin to the typical FOO_API
macro business that resolves to __declspec(dllexport)
or __declspec(dllimport)
on Windows. Or maybe only exporting symbols from specific files.
Alternatively you can apply https://github.com/llvm/llvm-project/issues/60607 and configure with -D HAVE_CLANG_REPL_SUPPORT=OFF
.
Back for round 3 (https://github.com/llvm/llvm-project/issues/60109 https://github.com/llvm/llvm-project/issues/56109)
The included
PrintFunctionNames
example can't be built because clang exports 82789 symbols, which exceeds the linkers limit. clang.symbols.ziperror message
cmake invocation
Clang version 18.1.3 VS version 17.10.0