[PATCH] D102736: Fix tmp files being left on Windows builds.

Amy Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 18 16:37:57 PDT 2021


akhuang created this revision.
akhuang added reviewers: rnk, aganea, amccarth.
Herald added subscribers: dexonsmith, hiraditya.
akhuang requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Clang writes object files by first writing to a .tmp file and then
renaming to the final .obj name. On Windows, if a compile is killed
partway through the .tmp files don't get deleted.

Currently it seems like `RemoveFileOnSignal` takes care of deleting the
tmp files on Linux, but on Windows we need to call
`setDeleteDisposition` on tmp files so that they are deleted when
closed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D102736

Files:
  clang/include/clang/Frontend/CompilerInstance.h
  clang/lib/Frontend/CompilerInstance.cpp
  llvm/include/llvm/Support/FileSystem.h
  llvm/lib/Support/Path.cpp
  llvm/lib/Support/Windows/Path.inc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102736.346302.patch
Type: text/x-patch
Size: 5181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210518/0b0ba0eb/attachment.bin>


More information about the llvm-commits mailing list