Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Compilation::CleanupFileList(const ArgStringList &Files,
- bool IssueErrors) const {
- bool Success = true;
- for (ArgStringList::const_iterator
- it = Files.begin(), ie = Files.end(); it != ie; ++it) {
- llvm::sys::Path P(*it);
- std::string Error;
- if (P.eraseFromDisk(false, &Error)) {
- // Failure is only failure if the file doesn't exist. There is a
- // race condition here due to the limited interface of
- // llvm::sys::Path, we want to know if the removal gave E_NOENT.
- // FIXME: Grumble, P.exists() is broken. PR3837.
- struct stat buf;
- if (::stat(P.c_str(), &buf) == 0
- || errno != ENOENT) {
- if (IssueErrors)
- getDriver().Diag(clang::diag::err_drv_unable_to_remove_file)
- << Error;
- Success = false;
- }
- }
- }
- return Success;
- }
Add Comment
Please, Sign In to add comment