LLVM  3.7.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::Linker Class Reference

This class provides the core functionality of linking in LLVM. More...

#include <Linker.h>

Classes

struct  IdentifiedStructTypeSet
 
struct  StructTypeKeyInfo
 

Public Types

typedef DenseSet< StructType
*, StructTypeKeyInfo
NonOpaqueStructTypeSet
 
typedef DenseSet< StructType * > OpaqueStructTypeSet
 

Public Member Functions

 Linker (Module *M, DiagnosticHandlerFunction DiagnosticHandler)
 
 Linker (Module *M)
 
 ~Linker ()
 
ModulegetModule () const
 
void deleteModule ()
 
bool linkInModule (Module *Src, bool OverrideSymbols=false)
 Link Src into the composite. More...
 
void setModule (Module *Dst)
 Set the composite to the passed-in module. More...
 

Static Public Member Functions

static bool LinkModules (Module *Dest, Module *Src, DiagnosticHandlerFunction DiagnosticHandler)
 This function links two modules together, with the resulting Dest module modified to be the composite of the two input modules. More...
 
static bool LinkModules (Module *Dest, Module *Src)
 

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

Member Typedef Documentation

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

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

Constructor & Destructor Documentation

Linker::Linker ( Module M,
DiagnosticHandlerFunction  DiagnosticHandler 
)

Definition at line 1744 of file LinkModules.cpp.

Linker::Linker ( Module M)

Definition at line 1748 of file LinkModules.cpp.

References llvm::LLVMContext::diagnose(), and llvm::Module::getContext().

Linker::~Linker ( )

Definition at line 1754 of file LinkModules.cpp.

Member Function Documentation

void Linker::deleteModule ( )

Definition at line 1757 of file LinkModules.cpp.

Module* llvm::Linker::getModule ( ) const
inline
bool Linker::linkInModule ( Module Src,
bool  OverrideSymbols = false 
)

Link Src into the composite.

The source is destroyed. Passing OverrideSymbols as true will have symbols from Src shadow those in the Dest. Returns true on error.

Definition at line 1762 of file LinkModules.cpp.

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

bool Linker::LinkModules ( Module Dest,
Module Src,
DiagnosticHandlerFunction  DiagnosticHandler 
)
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 1783 of file LinkModules.cpp.

References linkInModule().

Referenced by LLVMLinkModules().

bool Linker::LinkModules ( Module Dest,
Module Src 
)
static

Definition at line 1789 of file LinkModules.cpp.

References linkInModule().

void Linker::setModule ( Module Dst)

Set the composite to the passed-in module.

Definition at line 1770 of file LinkModules.cpp.

Referenced by llvm::LTOCodeGenerator::setModule().


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