aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-link
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-04 05:30:49 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-04 05:30:49 +0000
commitc1685b3a5052de377735f69e53e50741dbe5b52a (patch)
treee91b8ba1515c70c7236bb6b8b479d4e432dfd15c /tools/llvm-link
parentcfb320f5f97717c309832e0f92b97835526977a8 (diff)
Optimize llvm-link too.
This takes the linking of almost all modules in a clang build from 6:32 to 0:19. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-link')
-rw-r--r--tools/llvm-link/llvm-link.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 3a2d84a533..01a61c672c 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -93,6 +93,7 @@ int main(int argc, char **argv) {
return 1;
}
+ Linker L(Composite.get());
for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
OwningPtr<Module> M(LoadFile(argv[0], InputFilenames[i], Context));
if (M.get() == 0) {
@@ -102,8 +103,7 @@ int main(int argc, char **argv) {
if (Verbose) errs() << "Linking in '" << InputFilenames[i] << "'\n";
- if (Linker::LinkModules(Composite.get(), M.get(), Linker::DestroySource,
- &ErrorMessage)) {
+ if (L.linkInModule(M.get(), &ErrorMessage)) {
errs() << argv[0] << ": link error in '" << InputFilenames[i]
<< "': " << ErrorMessage << "\n";
return 1;