1 //===- Linker.cpp - Module Linker Implementation --------------------------===//
3 // This file implements the LLVM module linker.
6 // - Merges global variables between the two modules
7 // - Uninit + Uninit = Init, Init + Uninit = Init, Init + Init = Error if !=
9 //===----------------------------------------------------------------------===//
11 #include "llvm/Transforms/Linker.h"
14 // LinkModules - This function links two modules together, with the resulting
15 // left module modified to be the composite of the two input modules. If an
16 // error occurs, true is returned and ErrorMsg (if not null) is set to indicate
19 bool LinkModules(Module *Dest, const Module *Src, string *ErrorMsg = 0) {