1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:15:09 +00:00
serenity/Meta/Lagom/Tools/CodeGenerators/LibUnicode
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
..
CMakeLists.txt LibUnicode: Create a nearly empty generator for date-time formatting 2021-11-29 22:48:46 +00:00
GenerateUnicodeData.cpp LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00
GenerateUnicodeDateTimeFormat.cpp Lagom: Bind time_zone_list_index_type in the generator 2021-12-18 21:01:10 -08:00
GenerateUnicodeLocale.cpp LibUnicode: Generate unique list patterns and lists of list patterns 2021-12-13 21:28:56 -08:00
GenerateUnicodeNumberFormat.cpp LibUnicode: Define traits for a vector of integral/enum types 2021-12-13 21:28:56 -08:00
GeneratorUtil.h LibUnicode: Dynamically load the generated UnicodeData symbols 2021-12-21 13:09:49 -08:00