[llvm-commits] CVS: llvm/tools/gccld/gccld.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Apr 19 18:08:01 PDT 2003
Changes in directory llvm/tools/gccld:
gccld.cpp updated: 1.26 -> 1.27
---
Log message:
Eliminate useless duplicate libraries
---
Diffs of the changes:
Index: llvm/tools/gccld/gccld.cpp
diff -u llvm/tools/gccld/gccld.cpp:1.26 llvm/tools/gccld/gccld.cpp:1.27
--- llvm/tools/gccld/gccld.cpp:1.26 Sat Apr 19 17:44:38 2003
+++ llvm/tools/gccld/gccld.cpp Sat Apr 19 18:07:33 2003
@@ -120,7 +120,8 @@
bool &isArchive) {
if (FileExists(Directory + "lib" + LibName + ".a")) {
std::string ErrorMessage;
- if (Verbose) std::cerr << "Loading '" << Directory << LibName << ".a'\n";
+ if (Verbose) std::cerr << " Loading '" << Directory << "lib"
+ << LibName << ".a'\n";
if (!ReadArchiveFile(Directory + "lib" + LibName + ".a", Objects,
&ErrorMessage)) { // Read the archive file
isArchive = true;
@@ -128,7 +129,7 @@
}
if (Verbose) {
- std::cerr << "Error loading archive '" + Directory + "lib"+LibName+".a'";
+ std::cerr << " Error loading archive '" + Directory +"lib"+LibName+".a'";
if (!ErrorMessage.empty()) std::cerr << ": " << ErrorMessage;
std::cerr << "\n";
}
@@ -304,6 +305,10 @@
return PrintAndReturn(argv[0], ErrorMessage,
": error linking in '" + InputFilenames[i] + "'");
}
+
+ // Remove any consecutive duplicates of the same library...
+ Libraries.erase(std::unique(Libraries.begin(), Libraries.end()),
+ Libraries.end());
// Link in all of the libraries next...
for (unsigned i = 0; i != Libraries.size(); ++i) {
More information about the llvm-commits
mailing list