LLVM
8.0.1
|
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. More... | |
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. More... | |
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 572 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 574 of file LinkModules.cpp.
Referenced by linkModules().
|
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 591 of file LinkModules.cpp.
References linkInModule().
Referenced by LLVMLinkModules2().