mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 01:31:05 +00:00
Use Path::getFileStatus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29445 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0b32d8b764
commit
8bdbb04f9b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user