LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions
llvm::Linker Class Reference

#include <Linker.h>

List of all members.

Public Types

enum  LinkerMode { DestroySource = 0, PreserveSource = 1 }

Public Member Functions

 Linker (Module *M, bool SuppressWarnings=false)
 ~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.
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 28 of file Linker/Linker.h.


Member Enumeration Documentation

Enumerator:
DestroySource 
PreserveSource 

Definition at line 30 of file Linker/Linker.h.


Constructor & Destructor Documentation

Linker::Linker ( Module M,
bool  SuppressWarnings = false 
)

Definition at line 1724 of file LinkModules.cpp.


Member Function Documentation

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().


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