1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators
Timothy Flynn 3fd53baa25 LibUnicode: Dynamically load the generated UnicodeData symbols
The generated data for libunicodedata.so is quite large, and loading it
is a price paid by nearly every application by way of depending on
LibRegex. In order to defer this cost until an application actually uses
one of the surrounding APIs, dynamically load the generated symbols.

To be able to load the symbols dynamically, the generated methods must
have demangled names. Typically, this is accomplished with `extern "C"`
blocks. The clang toolchain complains about this here because the types
returned from the generators are strictly C++ types. So to demangle the
names, we use the asm() compiler directive to manually define a symbol
name; the caveat is that we *must* be sure the symbols are unique. As an
extra precaution, we prefix each symbol name with "unicode_". For more
details, see: https://gcc.gnu.org/onlinedocs/gcc/Asm-Labels.html

This symbol loader used in this implementation provides the additional
benefit of removing many [[maybe_unused]] attributes from the LibUnicode
methods. Internally, if ENABLE_UNICODE_DATABASE_DOWNLOAD is OFF, the
loader is able to stub out the function pointers it returns.

Note that as of this commit, LibUnicode is still directly linked against
LibUnicodeData. This commit is just a first step towards removing that.
2021-12-21 13:09:49 -08:00
..
IPCCompiler Everywhere: Fix -Winconsistent-missing-override warnings from Clang 2021-12-11 13:14:15 -08:00
LibUnicode LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
LibWeb LibWeb: Add support for the BufferSource IDL parameter type 2021-12-14 09:01:06 +01:00
StateMachineGenerator Meta: Define and use lagom_tool() CMake helper function for all Tools 2021-09-15 19:04:52 +04:30
CMakeLists.txt Everywhere: Move all host tools into the Lagom/Tools subdirectory 2021-08-28 08:44:17 +01:00