[llvm] [llvm][Support][Windows] Avoid crash calling remove_directories() (PR #118677)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 11 14:59:30 PST 2024
rnk wrote:
> * is there any advantage in doing this instead of the "manual" iterate-over-subdirectories approach (which is what the unix version of this does)? If not, we could probably even share code with that impl. I'm asking this because `SHFileOperationW` sounds like its meant for a shell, and we're not trying to be a shell -- we just want to make a directory disappear.
I think reliably recursively deleting files in a directory is actually a difficult problem (see this [2015 talk](https://www.youtube.com/watch?v=uhRWMGBjlO8&t=621s)), so Zach Turner probably reached for the native all-in-one API that was at hand. LLVM's directory deletion doesn't need to be bullet-proof, it needs to be good enough, especially given that the only clients are LLDB, dsymutil, and some unit tests. So, I think maybe Pavel is right, and maybe we should implement this using generic portable code.
https://github.com/llvm/llvm-project/pull/118677
More information about the llvm-commits
mailing list