LLVM API Documentation
#include "llvm/Linker.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
#include "llvm/SymbolTable.h"
#include "llvm/Instructions.h"
#include "llvm/Assembly/Writer.h"
#include "llvm/System/Path.h"
#include <iostream>
#include <sstream>
Include dependency graph for LinkModules.cpp:
Go to the source code of this file.
Functions | |
static bool | Error (std::string *E, const std::string &Message) |
static std::string | ToStr (const Type *Ty, const Module *M) |
static bool | ResolveTypes (const Type *DestTy, const Type *SrcTy, SymbolTable *DestST, const std::string &Name) |
static const FunctionType * | getFT (const PATypeHolder &TH) |
static const StructType * | getST (const PATypeHolder &TH) |
static bool | RecursiveResolveTypesI (const PATypeHolder &DestTy, const PATypeHolder &SrcTy, SymbolTable *DestST, const std::string &Name, std::vector< std::pair< PATypeHolder, PATypeHolder > > &Pointers) |
static bool | RecursiveResolveTypes (const PATypeHolder &DestTy, const PATypeHolder &SrcTy, SymbolTable *DestST, const std::string &Name) |
static bool | LinkTypes (Module *Dest, const Module *Src, std::string *Err) |
static void | PrintMap (const std::map< const Value *, Value * > &M) |
static Value * | RemapOperand (const Value *In, std::map< const Value *, Value * > &ValueMap) |
static void | ForceRenaming (GlobalValue *GV, const std::string &Name) |
static bool | GetLinkageResult (GlobalValue *Dest, GlobalValue *Src, GlobalValue::LinkageTypes <, bool &LinkFromSrc, std::string *Err) |
static bool | LinkGlobals (Module *Dest, Module *Src, std::map< const Value *, Value * > &ValueMap, std::multimap< std::string, GlobalVariable * > &AppendingVars, std::map< std::string, GlobalValue * > &GlobalsByName, std::string *Err) |
static bool | LinkGlobalInits (Module *Dest, const Module *Src, std::map< const Value *, Value * > &ValueMap, std::string *Err) |
static bool | LinkFunctionProtos (Module *Dest, const Module *Src, std::map< const Value *, Value * > &ValueMap, std::map< std::string, GlobalValue * > &GlobalsByName, std::string *Err) |
static bool | LinkFunctionBody (Function *Dest, Function *Src, std::map< const Value *, Value * > &GlobalMap, std::string *Err) |
static bool | LinkFunctionBodies (Module *Dest, Module *Src, std::map< const Value *, Value * > &ValueMap, std::string *Err) |
static bool | LinkAppendingVars (Module *M, std::multimap< std::string, GlobalVariable * > &AppendingVars, std::string *ErrorMsg) |
bool | llvm::LinkModules (Module *Dest, Module *Src, std::string *ErrorMsg) |
Link two modules together. |
|
Definition at line 33 of file LinkModules.cpp. Referenced by llvm::JIT::create(), GetLinkageResult(), LinkAppendingVars(), LinkFunctionProtos(), LinkGlobalInits(), and LinkGlobals(). |
|
ForceRenaming - The LLVM SymbolTable class autorenames globals that conflict in the symbol table. This is good for all clients except for us. Go through the trouble to force this back. Definition at line 359 of file LinkModules.cpp. References llvm::Value::getName(), llvm::GlobalValue::getParent(), llvm::Module::getSymbolTable(), llvm::GlobalValue::getType(), llvm::GlobalValue::hasInternalLinkage(), llvm::SymbolTable::lookup(), and llvm::Constant::setName(). Referenced by LinkFunctionProtos(), and LinkGlobals(). |
|
Definition at line 84 of file LinkModules.cpp. References llvm::PATypeHolder::get(). Referenced by RecursiveResolveTypesI(). |
|
GetLinkageResult - This analyzes the two global values and determines what the result will look like in the destination module. In particular, it computes the resultant linkage type, computes whether the global in the source should be copied over to the destination (replacing the existing one), and computes whether this linkage is an error or not. Definition at line 382 of file LinkModules.cpp. References Error(), llvm::GlobalValue::ExternalLinkage, llvm::GlobalValue::getLinkage(), llvm::Value::getName(), llvm::GlobalValue::hasAppendingLinkage(), llvm::GlobalValue::hasExternalLinkage(), llvm::GlobalValue::hasInternalLinkage(), llvm::GlobalValue::hasLinkOnceLinkage(), llvm::GlobalValue::hasWeakLinkage(), and llvm::GlobalValue::isExternal(). Referenced by LinkGlobals(). |
|
Definition at line 87 of file LinkModules.cpp. References llvm::PATypeHolder::get(). Referenced by RecursiveResolveTypesI(). |
|
|
Definition at line 712 of file LinkModules.cpp. References llvm::Module::begin(), llvm::X86II::DF, E, llvm::Module::end(), llvm::Function::isExternal(), and LinkFunctionBody(). Referenced by llvm::LinkModules(). |
|
Definition at line 671 of file LinkModules.cpp. References llvm::Function::abegin(), llvm::Function::aend(), llvm::Function::begin(), E, llvm::Function::end(), llvm::Function::getBasicBlockList(), I, llvm::Function::isExternal(), and RemapOperand(). Referenced by LinkFunctionBodies(). |
|
|
|
|
Definition at line 176 of file LinkModules.cpp. References llvm::Module::getSymbolTable(), llvm::SymbolTable::lookupType(), RecursiveResolveTypes(), ResolveTypes(), llvm::SymbolTable::type_begin(), llvm::SymbolTable::type_end(), and llvm::WriteTypeSymbolic(). Referenced by llvm::LinkModules(). |
|
Definition at line 263 of file LinkModules.cpp. Referenced by RemapOperand(). |
|
Definition at line 165 of file LinkModules.cpp. References PointerTypes, and RecursiveResolveTypesI(). Referenced by LinkFunctionProtos(), LinkGlobals(), and LinkTypes(). |
|
Definition at line 94 of file LinkModules.cpp. References llvm::Type::ArrayTyID, first, llvm::Type::FunctionTyID, llvm::PATypeHolder::get(), llvm::SequentialType::getElementType(), getFT(), llvm::ArrayType::getNumElements(), getST(), llvm::Type::PointerTyID, ResolveTypes(), and llvm::Type::StructTyID. Referenced by RecursiveResolveTypes(). |
|
Definition at line 278 of file LinkModules.cpp. References llvm::Instruction::Cast, llvm::ConstantExpr::get(), llvm::ConstantStruct::get(), llvm::ConstantArray::get(), llvm::ConstantExpr::getCast(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getSelect(), I, PrintMap(), llvm::Select, and V. Referenced by LinkFunctionBody(), and LinkGlobalInits(). |
|
Definition at line 63 of file LinkModules.cpp. References llvm::SymbolTable::insert(). |
|
Definition at line 39 of file LinkModules.cpp. References llvm::WriteTypeSymbolic(). Referenced by LinkFunctionProtos(), and LinkGlobalInits(). |