diff options
Diffstat (limited to 'llvm/lib/Support/FileCollector.cpp')
-rw-r--r-- | llvm/lib/Support/FileCollector.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/Support/FileCollector.cpp b/llvm/lib/Support/FileCollector.cpp index 5975555..4c72f2b 100644 --- a/llvm/lib/Support/FileCollector.cpp +++ b/llvm/lib/Support/FileCollector.cpp @@ -158,14 +158,6 @@ std::error_code FileCollector::copyFiles(bool StopOnError) { std::lock_guard<std::mutex> lock(Mutex); for (auto &entry : VFSWriter.getMappings()) { - // Create directory tree. - if (std::error_code EC = - sys::fs::create_directories(sys::path::parent_path(entry.RPath), - /*IgnoreExisting=*/true)) { - if (StopOnError) - return EC; - } - // Get the status of the original file/directory. sys::fs::file_status Stat; if (std::error_code EC = sys::fs::status(entry.VPath, Stat)) { @@ -174,6 +166,18 @@ std::error_code FileCollector::copyFiles(bool StopOnError) { continue; } + // Continue if the file doesn't exist. + if (Stat.type() == sys::fs::file_type::file_not_found) + continue; + + // Create directory tree. + if (std::error_code EC = + sys::fs::create_directories(sys::path::parent_path(entry.RPath), + /*IgnoreExisting=*/true)) { + if (StopOnError) + return EC; + } + if (Stat.type() == sys::fs::file_type::directory_file) { // Construct a directory when it's just a directory entry. if (std::error_code EC = |