diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 17:18:19 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 17:18:19 +0000 |
commit | 0afe178f21bf2ba5de1041a07dface9ab4a91277 (patch) | |
tree | 9094efe2afe37296f4806ac3d2617ae669396eaf /llvm/tools/gccld/gccld.cpp | |
parent | f51f490b7b0a4a3e4e9ee14ec0b246ac749dcd02 (diff) | |
download | bcm5719-llvm-0afe178f21bf2ba5de1041a07dface9ab4a91277.tar.gz bcm5719-llvm-0afe178f21bf2ba5de1041a07dface9ab4a91277.zip |
Make the loop termination condition clear when building the set of items to
pass to the Linker::LinkInItems function.
llvm-svn: 18894
Diffstat (limited to 'llvm/tools/gccld/gccld.cpp')
-rw-r--r-- | llvm/tools/gccld/gccld.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/tools/gccld/gccld.cpp b/llvm/tools/gccld/gccld.cpp index db03b208b91..41c176f8690 100644 --- a/llvm/tools/gccld/gccld.cpp +++ b/llvm/tools/gccld/gccld.cpp @@ -173,7 +173,7 @@ static void BuildLinkItems( cl::list<std::string>::const_iterator libIt = Libraries.begin(); int libPos = -1, filePos = -1; - while ( 1 ) { + while ( libIt != Libraries.end() || fileIt != Files.end() ) { if (libIt != Libraries.end()) libPos = Libraries.getPosition(libIt - Libraries.begin()); else @@ -189,11 +189,10 @@ static void BuildLinkItems( } else if (libPos != -1 && (filePos == -1 || libPos < filePos)) { // Add a library Items.push_back(std::make_pair(*libIt++, true)); - } else { - break; // we're done with the list } } } + int main(int argc, char **argv, char **envp) { cl::ParseCommandLineOptions(argc, argv, " llvm linker for GCC\n"); sys::PrintStackTraceOnErrorSignal(); |