From 603d6b56a2b72358e7b599aab743beb44823d76c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 23 Jan 2012 03:41:53 +0000 Subject: The iteration order over a std::set depends on the addresses of the modules. Avoid that to make the order the linker sees the modules deterministic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148676 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Linker/LinkArchives.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Linker/LinkArchives.cpp') diff --git a/lib/Linker/LinkArchives.cpp b/lib/Linker/LinkArchives.cpp index 7a59424652..c16d1958cd 100644 --- a/lib/Linker/LinkArchives.cpp +++ b/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 Modules; + SmallVector 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::iterator I=Modules.begin(), E=Modules.end(); + for (SmallVectorImpl::iterator I=Modules.begin(), E=Modules.end(); I != E; ++I) { // Get the module we must link in. -- cgit v1.2.3-18-g5258