summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Linker
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-01-23 03:41:53 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-01-23 03:41:53 +0000
commitabf456e32037a39a3f8e95cc3ec3a0435f3800d3 (patch)
treee7dced48b945e3998d25a4fc069b3946dff6ddf4 /llvm/lib/Linker
parent94e746d5e502d13e39b71cd09d87daf93b441985 (diff)
downloadbcm5719-llvm-abf456e32037a39a3f8e95cc3ec3a0435f3800d3.tar.gz
bcm5719-llvm-abf456e32037a39a3f8e95cc3ec3a0435f3800d3.zip
The iteration order over a std::set<Module*> depends on the addresses of the
modules. Avoid that to make the order the linker sees the modules deterministic. llvm-svn: 148676
Diffstat (limited to 'llvm/lib/Linker')
-rw-r--r--llvm/lib/Linker/LinkArchives.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Linker/LinkArchives.cpp b/llvm/lib/Linker/LinkArchives.cpp
index 7a594246523..c16d1958cdf 100644
--- a/llvm/lib/Linker/LinkArchives.cpp
+++ b/llvm/lib/Linker/LinkArchives.cpp
@@ -140,7 +140,7 @@ Linker::LinkInArchive(const sys::Path &Filename, bool &is_native) {
// Find the modules we need to link into the target module. Note that arch
// keeps ownership of these modules and may return the same Module* from a
// subsequent call.
- std::set<Module*> Modules;
+ SmallVector<Module*, 16> Modules;
if (!arch->findModulesDefiningSymbols(UndefinedSymbols, Modules, &ErrMsg))
return error("Cannot find symbols in '" + Filename.str() +
"': " + ErrMsg);
@@ -157,7 +157,7 @@ Linker::LinkInArchive(const sys::Path &Filename, bool &is_native) {
UndefinedSymbols.end());
// Loop over all the Modules that we got back from the archive
- for (std::set<Module*>::iterator I=Modules.begin(), E=Modules.end();
+ for (SmallVectorImpl<Module*>::iterator I=Modules.begin(), E=Modules.end();
I != E; ++I) {
// Get the module we must link in.
OpenPOWER on IntegriCloud