LLVM API Documentation
#include <Linker.h>
Public Types | |
enum | LinkerMode { DestroySource = 0, PreserveSource = 1 } |
Public Member Functions | |
Linker (Module *M, bool SuppressWarnings=false) | |
~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. | |
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.
Definition at line 28 of file Linker/Linker.h.
Definition at line 30 of file Linker/Linker.h.
Linker::Linker | ( | Module * | M, |
bool | SuppressWarnings = false |
||
) |
Definition at line 1717 of file LinkModules.cpp.
References llvm::TypeFinder::begin(), llvm::TypeFinder::end(), llvm::SmallPtrSetImpl< PtrType >::insert(), and llvm::TypeFinder::run().
Linker::~Linker | ( | ) |
Definition at line 1724 of file LinkModules.cpp.
void Linker::deleteModule | ( | ) |
Definition at line 1727 of file LinkModules.cpp.
Referenced by llvm::LTOCodeGenerator::~LTOCodeGenerator().
Module* llvm::Linker::getModule | ( | ) | const [inline] |
Definition at line 38 of file Linker/Linker.h.
Referenced by llvm::LTOCodeGenerator::writeMergedModules().
bool Linker::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.
Definition at line 1732 of file LinkModules.cpp.
Referenced by llvm::LTOCodeGenerator::addModule(), linkInModule(), and LinkModules().
bool llvm::Linker::linkInModule | ( | Module * | Src, |
std::string * | ErrorMsg | ||
) | [inline] |
Definition at line 47 of file Linker/Linker.h.
References DestroySource, and linkInModule().
bool Linker::LinkModules | ( | Module * | Dest, |
Module * | Src, | ||
unsigned | Mode, | ||
std::string * | ErrorMsg | ||
) | [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 1752 of file LinkModules.cpp.
References linkInModule().
Referenced by LLVMLinkModules().