Skip to content

Commit 631ad44

Browse files
fsfodasl
authored andcommitted
Add ids paragraph
1 parent 1cc3d59 commit 631ad44

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/posts/2024-11-23-gsoc-windows-plugins.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ In order to support DLL builds on MinGW, a [python script](https://github.com/ll
1616
## What We Did
1717
Some initial work I did was update the LLVM CMake build system to be able to build a LLVM DLL and use clang-cl's [/Zc:dllexportInlines-](https://blog.llvm.org/2018/11/30-faster-windows-builds-with-clang-cl_14.html). Inline declared class methods by default are not compiled unless used, but when the `__declspec(dllexport)` attribute is applied to a class all its methods are compiled and exported by the compiler even if not used. This option negates this behaviour, preventing inline methods from being compiled and exported. This avoids emitting these methods in every translation unit including the declaration, greatly reducing compile times for DLL builds. More importantly, it almost halves the number of symbols exported for LLVM to 28k and Clang DLL to 20k. The cost of this improvement is that DLLs built with this option cannot be consumed by code being built with MSVC as that code expects these methods to be available externally. There is a Microsoft Developer Community [issue](https://developercommunity.visualstudio.com/t/implement-zcdllexportinlines-aka-fvisibility-inlin/374754) to add it to MSVC, please consider voting for it so that it may be considered by Microsoft for addition to the MSVC toolchain.
1818

19+
Another major thing I worked on was extending a Clang tooling based tool [ids](https://github.com/compnerd/ids) that Saleem Abdulrasool created to automate adding symbol visibility macros to classes, global functions and variables in public LLVM and Clang headers. I made its file processing multi-threaded and added a config file system to make it simple to add exclusions for different headers and directories when adding macro annotations. I also changed it to automatically add a include the header that defines the visibility macros when code is annotated by macros in a file.
20+
1921
I managed to get plugins for Clang and LLVM working including passing the LLVM and Clang test suite when building with clang-cl. Some of the changes to support this have already merged LLVM and Clang or are waiting in open PRs, but it will take some time to get all the changes merged across the whole LLVM and Clang codebase.
2022
The greatly reduced install size from using a non statically linked build of LLVM tools and Clang could also help with [current limitation](https://github.com/llvm/llvm-project/issues/101994) of the installer used for the official distribution on windows that forced the number of targets included in the official distribution to be limited. It would shrink from over 2GB to close to 500MB.
2123

0 commit comments

Comments
 (0)