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 | 75db664f440299def2dca31f64e49921d90ca65b (patch) | |
| tree | 3ef2d70792f7931f14eca1565fcfe9bfe79f12a1 /llvm/lib/Linker/LinkItems.cpp | |
| parent | ebdf6f46eb31be298674a58887dcb921510369a0 (diff) | |
| download | bcm5719-llvm-75db664f440299def2dca31f64e49921d90ca65b.tar.gz bcm5719-llvm-75db664f440299def2dca31f64e49921d90ca65b.zip | |
For PR998:
Fix an infinite loop in the Linker and a few other assorted link problems.
Patch contributed by Scott Michel. Thanks, Scott!
llvm-svn: 31680
Diffstat (limited to 'llvm/lib/Linker/LinkItems.cpp')
| -rw-r--r-- | llvm/lib/Linker/LinkItems.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Linker/LinkItems.cpp b/llvm/lib/Linker/LinkItems.cpp index aaa87dcb377..22e66144057 100644 --- a/llvm/lib/Linker/LinkItems.cpp +++ b/llvm/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."); |

