Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. bool Compilation::CleanupFileList(const ArgStringList &Files,
  2. bool IssueErrors) const {
  3. bool Success = true;
  4.  
  5. for (ArgStringList::const_iterator
  6. it = Files.begin(), ie = Files.end(); it != ie; ++it) {
  7. llvm::sys::Path P(*it);
  8. std::string Error;
  9.  
  10. if (P.eraseFromDisk(false, &Error)) {
  11. // Failure is only failure if the file doesn't exist. There is a
  12. // race condition here due to the limited interface of
  13. // llvm::sys::Path, we want to know if the removal gave E_NOENT.
  14.  
  15. // FIXME: Grumble, P.exists() is broken. PR3837.
  16. struct stat buf;
  17. if (::stat(P.c_str(), &buf) == 0
  18. || errno != ENOENT) {
  19. if (IssueErrors)
  20. getDriver().Diag(clang::diag::err_drv_unable_to_remove_file)
  21. << Error;
  22. Success = false;
  23. }
  24. }
  25. }
  26.  
  27. return Success;
  28. }
Add Comment
Please, Sign In to add comment