[all-commits] [llvm/llvm-project] 4299d8: [ORC] Add MaterializationUnit::Interface parameter...

lhames via All-commits all-commits at lists.llvm.org
Tue Dec 14 17:10:26 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4299d8d0ce420f832134a979a8cc2868cc717bb8
      https://github.com/llvm/llvm-project/commit/4299d8d0ce420f832134a979a8cc2868cc717bb8
  Author: Lang Hames <lhames at gmail.com>
  Date:   2021-12-15 (Wed, 15 Dec 2021)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/Layer.h
    M llvm/include/llvm/ExecutionEngine/Orc/Mangling.h
    A llvm/include/llvm/ExecutionEngine/Orc/ObjectFileInterface.h
    M llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
    M llvm/lib/ExecutionEngine/Orc/Layer.cpp
    M llvm/lib/ExecutionEngine/Orc/Mangling.cpp
    A llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.cpp
    M llvm/tools/llvm-jitlink/llvm-jitlink.h

  Log Message:
  -----------
  [ORC] Add MaterializationUnit::Interface parameter to ObjectLayer::add.

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).




More information about the All-commits mailing list