diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-08-01 18:09:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-08-01 18:09:46 +0000 |
| commit | 63c5e1cf925008e0c8f9a2c2d9634f1e9327892a (patch) | |
| tree | e5323ade1fa39817ac232ade7ab32f6e31d5360f | |
| parent | 32ffbc316a214be2ed04e2bf276f3982b4d452bf (diff) | |
| download | bcm5719-llvm-63c5e1cf925008e0c8f9a2c2d9634f1e9327892a.tar.gz bcm5719-llvm-63c5e1cf925008e0c8f9a2c2d9634f1e9327892a.zip | |
Use Path::getFileStatus
llvm-svn: 29445
| -rw-r--r-- | llvm/tools/llvm-ar/llvm-ar.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp index 2ec431727a6..d2d8c85e27f 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp @@ -270,19 +270,22 @@ ArchiveOperation parseCommandLine() { // finds with all the files in that directory (recursively). It uses the // sys::Path::getDirectoryContent method to perform the actual directory scans. std::set<sys::Path> recurseDirectories(const sys::Path& path) { - assert(path.isDirectory() && "Oops, can't recurse a file"); std::set<sys::Path> result; if (RecurseDirectories) { std::set<sys::Path> content; path.getDirectoryContents(content); for (std::set<sys::Path>::iterator I = content.begin(), E = content.end(); I != E; ++I) { - if (I->isDirectory()) { - std::set<sys::Path> moreResults = recurseDirectories(*I); - result.insert(moreResults.begin(), moreResults.end()); - } else { - result.insert(*I); - } + // Make sure it exists and is a directory + sys::FileStatus Status; + if (!I->getFileStatus(Status)) { + if (Status.isDir) { + std::set<sys::Path> moreResults = recurseDirectories(*I); + result.insert(moreResults.begin(), moreResults.end()); + } else { + result.insert(*I); + } + } } } return result; |

