diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-11-11 11:54:25 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-11-11 11:54:25 +0000 |
commit | 4952143236afe43b974798c45ed265bb175c9d7f (patch) | |
tree | 3b5e0e979f39154d18b36fbb5ee60ef323650393 /lib/Linker/LinkItems.cpp | |
parent | 44e2f8f9fae4a7d960390eb486eaedd38ea0ce51 (diff) |
For PR998:
Fix an infinite loop in the Linker and a few other assorted link problems.
Patch contributed by Scott Michel. Thanks, Scott!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31680 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker/LinkItems.cpp')
-rw-r--r-- | lib/Linker/LinkItems.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Linker/LinkItems.cpp b/lib/Linker/LinkItems.cpp index aaa87dcb37..22e6614405 100644 --- a/lib/Linker/LinkItems.cpp +++ b/lib/Linker/LinkItems.cpp @@ -32,10 +32,10 @@ Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) { I != E; ++I) { if (I->second) { // Link in the library suggested. - bool is_file = true; - if (LinkInLibrary(I->first,is_file)) + bool is_bytecode = true; + if (LinkInLibrary(I->first,is_bytecode)) return true; - if (!is_file) + if (!is_bytecode) NativeItems.push_back(*I); } else { // Link in the file suggested @@ -61,8 +61,8 @@ Linker::LinkInItems(const ItemList& Items, ItemList& NativeItems) { /// LinkInLibrary - links one library into the HeadModule. /// -bool Linker::LinkInLibrary(const std::string& Lib, bool& is_file) { - is_file = false; +bool Linker::LinkInLibrary(const std::string& Lib, bool& is_bytecode) { + is_bytecode = false; // Determine where this library lives. sys::Path Pathname = FindLib(Lib); if (Pathname.isEmpty()) @@ -77,11 +77,12 @@ bool Linker::LinkInLibrary(const std::string& Lib, bool& is_file) { // LLVM ".so" file. if (LinkInFile(Pathname)) return error("Cannot link file '" + Pathname.toString() + "'"); - is_file = true; + is_bytecode = true; break; case sys::ArchiveFileType: if (LinkInArchive(Pathname)) return error("Cannot link archive '" + Pathname.toString() + "'"); + is_bytecode = true; break; default: return warning("Supposed library '" + Lib + "' isn't a library."); |