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.
This patch uses llvm::sys::fs::TempFile to create these files on Windows.
clang-tidy: error: cannot initialize a parameter of type 'llvm::sys::fs::file_t' (aka 'int') with an rvalue of type 'nullptr_t' [clang-diagnostic-error]
not useful