Skip to content

Commit

Permalink
Optimize llvm-link too.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
espindola committed May 4, 2013
1 parent cfb320f commit c1685b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/llvm-link/llvm-link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit c1685b3

Please sign in to comment.