[llvm] [llvm][Support][Windows] Avoid crash calling remove_directories() (PR #118677)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 7 13:41:18 PST 2024
mstorsjo wrote:
> > which is not needed for this operation. By disabling CopyHooks we will increase performance and improve stability in any case.
>
> This might be a sufficient reason, if true, which I simply just don't know. @mstorsjo, what do you make of this?
I'm not entirely sure. Based on the linked blog post, this does seem like a recommended way of doing it, but invoking COM objects just for deleting a set of files/directories does also feel a bit like overkill.
> We now build llvm for C++17 so I don't see why not.
Even though the compilers generally support C++17, `std::filesystem` was generally added quite late in many C++ standard library implementations, in particular on Windows. (In libc++, support for it was merged only a couple years ago.)
So if possible, using common code shared with Unix, for traversing the file tree and recursively deleting files/directories, sounds like my preferred way forward as well, unless we have other arguments for not doing that. (Why was this codepath using shell32 for deleting directories in the first place?)
https://github.com/llvm/llvm-project/pull/118677
More information about the llvm-commits
mailing list