[PATCH] D112376: [Support] [Windows] Use the regular RemoveFileOnSignal() mechanism on Windows too

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 26 12:37:03 PDT 2021


mstorsjo added a comment.

In D112376#3088498 <https://reviews.llvm.org/D112376#3088498>, @rnk wrote:

> I was going to try to come up with one last alternative, something like splitting OF_Delete into OF_DeleteOnClose and OF_Delete. One gives you the ability to delete the file, and the other is the old delete-on-close semantic. Does that work? Sorry for the delay, apologies if I missed something while skimming...

On second thought, we don't even need to split it - we could just change the `OF_Delete` flag into "just set the delete access mode, nothing else" and call `setDeleteDisposition` directly from `TempFile::create`. Then we could either keep the approach of checking `is_local` for deciding whether we should call `setDeleteDisposition`, or go back to making `setDeleteDisposition` update a reference parameter about whether it did something or not. (But those bool reference returns are a bit ugly, so unless there's some unforseen issue with upfront checking with `is_local`, maybe that's cleaner.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112376/new/

https://reviews.llvm.org/D112376



More information about the llvm-commits mailing list