mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 14:46:07 +00:00

Also moves object interface building functions out of Mangling.h and in to the new ObjectFileInterfaces.h header, and updates the llvm-jitlink tool to use custom object interfaces rather than a custom link layer. ObjectLayer::add overloads are added to match the old signatures (which do not take a MaterializationUnit::Interface). These overloads use the standard getObjectFileInterface function to build an interface. Passing a MaterializationUnit::Interface explicitly makes it easier to alter the effective interface of the object file being added, e.g. by changing symbol visibility/linkage, or renaming symbols (in both cases the changes will need to be mirrored by a JITLink pass at link time to update the LinkGraph to match the explicit interface). Altering interfaces in this way can be useful when lazily compiling (e.g. for renaming function bodies) or emulating linker options (e.g. demoting all symbols to hidden visibility to emulate -load_hidden).