LLVM 20.0.0git
|
This class provides the core functionality of linking in LLVM. More...
#include "llvm/Linker/Linker.h"
Public Types | |
enum | Flags { None = 0 , OverrideFromSrc = (1 << 0) , LinkOnlyNeeded = (1 << 1) } |
Public Member Functions | |
Linker (Module &M) | |
bool | linkInModule (std::unique_ptr< Module > Src, unsigned Flags=Flags::None, std::function< void(Module &, const StringSet<> &)> InternalizeCallback={}) |
Link Src into the composite. | |
Static Public Member Functions | |
static bool | linkModules (Module &Dest, std::unique_ptr< Module > Src, unsigned Flags=Flags::None, std::function< void(Module &, const StringSet<> &)> InternalizeCallback={}) |
This function links two modules together, with the resulting Dest module modified to be the composite of the two input modules. | |
This class provides the core functionality of linking in LLVM.
It keeps a pointer to the merged module so far. It doesn't take ownership of the module since it is assumed that the user of this class will want to do something with it after the linking.
enum llvm::Linker::Flags |
Linker::Linker | ( | Module & | M | ) |
Definition at line 621 of file LinkModules.cpp.
bool Linker::linkInModule | ( | std::unique_ptr< Module > | Src, |
unsigned | Flags = Flags::None , |
||
std::function< void(Module &, const StringSet<> &)> | InternalizeCallback = {} |
||
) |
Link Src
into the composite.
Passing OverrideSymbols as true will have symbols from Src shadow those in the Dest.
Passing InternalizeCallback will have the linker call the function with the new module and a list of global value names to be internalized by the callback.
Returns true on error.
Definition at line 623 of file LinkModules.cpp.
|
static |
This function links two modules together, with the resulting Dest module modified to be the composite of the two input modules.
If an error occurs, true is returned and ErrorMsg (if not null) is set to indicate the problem. Upon failure, the Dest module could be in a modified state, and shouldn't be relied on to be consistent.
Definition at line 640 of file LinkModules.cpp.
Referenced by LLVMLinkModules2().