LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::Linker Class Reference

#include <Linker.h>

Public Types

enum  LinkerMode { DestroySource = 0, PreserveSource = 1 }
 

Public Member Functions

 Linker (Module *M)
 
 ~Linker ()
 
ModulegetModule () 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)
 

Detailed Description

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 26 of file Linker.h.

Member Enumeration Documentation

Enumerator
DestroySource 
PreserveSource 

Definition at line 28 of file Linker.h.

Constructor & Destructor Documentation

Linker::Linker ( Module M)
Linker::~Linker ( )

Definition at line 1352 of file LinkModules.cpp.

Member Function Documentation

void Linker::deleteModule ( )

Definition at line 1355 of file LinkModules.cpp.

Referenced by LTOCodeGenerator::~LTOCodeGenerator().

Module* llvm::Linker::getModule ( ) const
inline

Definition at line 36 of file Linker.h.

Referenced by 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 1360 of file LinkModules.cpp.

Referenced by LTOCodeGenerator::addModule(), linkInModule(), and LinkModules().

bool llvm::Linker::linkInModule ( Module Src,
std::string *  ErrorMsg 
)
inline

Definition at line 45 of file 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 1379 of file LinkModules.cpp.

References linkInModule().

Referenced by LLVMLinkModules().


The documentation for this class was generated from the following files: