[all-commits] [llvm/llvm-project] 659bf6: [Support] [Windows] Don't cancel delete if we fail...

Shezan Baig via All-commits all-commits at lists.llvm.org
Thu Jan 27 03:58:57 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 659bf6d08c00993b777a96041ffaa98243464598
      https://github.com/llvm/llvm-project/commit/659bf6d08c00993b777a96041ffaa98243464598
  Author: Shezan Baig <sbaig1 at bloomberg.net>
  Date:   2022-01-27 (Thu, 27 Jan 2022)

  Changed paths:
    M llvm/lib/Support/Path.cpp

  Log Message:
  -----------
  [Support] [Windows] Don't cancel delete if we failed to set delete

Following up on commit 177176f75c6fa3f624d6d964b9d340ce39511565, if we
failed to setDeleteDisposition(true) during TempFile creation, then
don't try to setDeleteDisposition(false) during TempFile::keep, since it
will likely fail as well.

Instead of letting TempFile::keep just fail, we should let it go ahead
and try renaming the file.

This fixes an issue we are seeing when running clang-cl.exe through the
Incredibuild distributed build system.  We're seeing that renaming
temporary object files would fail here:
https://github.com/llvm/llvm-project/blob/5c1f7b296ac0dddeca02891976e6ab5cfc006719/clang/lib/Frontend/CompilerInstance.cpp#L789

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D118212




More information about the All-commits mailing list