summaryrefslogtreecommitdiff
path: root/tools/llvm-link
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2011-10-11 00:24:54 +0000
committerTanya Lattner <tonic@nondot.org>2011-10-11 00:24:54 +0000
commitf1f1a4f16128ffa2910f0b1d5c7052b3697f9fcd (patch)
tree8cff133c6dd3061600643273205cae6d25b9ace9 /tools/llvm-link
parentfad138dd79d025229433c9de90108df4eb81f4af (diff)
downloadllvm-f1f1a4f16128ffa2910f0b1d5c7052b3697f9fcd.tar.gz
llvm-f1f1a4f16128ffa2910f0b1d5c7052b3697f9fcd.tar.bz2
llvm-f1f1a4f16128ffa2910f0b1d5c7052b3697f9fcd.tar.xz
Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored-- M include/llvm/Linker.h M tools/bugpoint/Miscompilation.cpp M tools/bugpoint/BugDriver.cpp M tools/llvm-link/llvm-link.cpp M lib/Linker/LinkModules.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141606 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r--tools/llvm-link/llvm-link.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 3fb7ba42cd..95ad1ca5a1 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -103,7 +103,8 @@ int main(int argc, char **argv) {
if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n";
- if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
+ if (Linker::LinkModules(Composite.get(), M.get(), Linker::DestroySource,
+ &ErrorMessage)) {
errs() << argv[0] << ": link error in '" << InputFilenames[i]
<< "': " << ErrorMessage << "\n";
return 1;