aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-link/llvm-link.cpp
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2018-02-21 15:13:48 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2018-02-21 15:13:48 +0000
commitc556974f720ddfc31793f312e4024c6045ce5140 (patch)
tree29a5a3fe2c75171cb6bcfcd36fdda7da3eccc1b2 /llvm/tools/llvm-link/llvm-link.cpp
parent9c669e13c9ce0eb5a835e897699cfefc14e3ed4a (diff)
downloadllvm-c556974f720ddfc31793f312e4024c6045ce5140.zip
llvm-c556974f720ddfc31793f312e4024c6045ce5140.tar.gz
llvm-c556974f720ddfc31793f312e4024c6045ce5140.tar.bz2
[IRMover] Implement name based structure type mapping
Differential revision: https://reviews.llvm.org/D43199 llvm-svn: 325686
Diffstat (limited to 'llvm/tools/llvm-link/llvm-link.cpp')
-rw-r--r--llvm/tools/llvm-link/llvm-link.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 1ada60e..8d29caf 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -70,6 +70,11 @@ static cl::opt<std::string>
OutputFilename("o", cl::desc("Override output filename"), cl::init("-"),
cl::value_desc("filename"));
+static cl::opt<std::string>
+ InitialModule("initial-module",
+ cl::desc("Link to existing destination module"), cl::init(""),
+ cl::value_desc("filename"));
+
static cl::opt<bool>
Internalize("internalize", cl::desc("Internalize linked symbols"));
@@ -360,7 +365,9 @@ int main(int argc, char **argv) {
if (!DisableDITypeMap)
Context.enableDebugTypeODRUniquing();
- auto Composite = make_unique<Module>("llvm-link", Context);
+ auto Composite = InitialModule.empty()
+ ? make_unique<Module>("llvm-link", Context)
+ : loadFile(argv[0], InitialModule, Context);
Linker L(*Composite);
unsigned Flags = Linker::Flags::None;