LLVM API Documentation
#include <Linker.h>
Public Types | |
enum | LinkerMode { DestroySource = 0, PreserveSource = 1 } |
Public Member Functions | |
Linker (Module *M) | |
~Linker () | |
Module * | getModule () const |
void | deleteModule () |
bool | linkInModule (Module *Src, unsigned Mode, std::string *ErrorMsg) |
Link Src into the composite. The source is destroyed if Mode is DestroySource and preserved if it is PreserveSource. If ErrorMsg is not null, information about any error is written to it. Returns true on error. More... | |
bool | linkInModule (Module *Src, std::string *ErrorMsg) |
Static Public Member Functions | |
static bool | LinkModules (Module *Dest, Module *Src, unsigned Mode, std::string *ErrorMsg) |
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.
Linker::Linker | ( | Module * | M | ) |
Definition at line 1346 of file LinkModules.cpp.
References llvm::TypeFinder::begin(), llvm::TypeFinder::end(), and llvm::TypeFinder::run().
Linker::~Linker | ( | ) |
Definition at line 1352 of file LinkModules.cpp.
void Linker::deleteModule | ( | ) |
Definition at line 1355 of file LinkModules.cpp.
Referenced by LTOCodeGenerator::~LTOCodeGenerator().
|
inline |
Definition at line 36 of file Linker.h.
Referenced by LTOCodeGenerator::writeMergedModules().
Link Src
into the composite. The source is destroyed if Mode
is DestroySource and preserved if it is PreserveSource. If ErrorMsg
is not null, information about any error is written to it. Returns true on error.
Definition at line 1360 of file LinkModules.cpp.
Referenced by LTOCodeGenerator::addModule(), linkInModule(), and LinkModules().
Definition at line 45 of file Linker.h.
References DestroySource, and linkInModule().
|
static |
LinkModules - 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 1379 of file LinkModules.cpp.
References linkInModule().
Referenced by LLVMLinkModules().