[PATCH] D65545: Handle some fs::remove failures
Jan Korous via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 1 15:19:03 PDT 2019
jkorous added inline comments.
Comment at: clang/lib/Frontend/PrecompiledPreamble.cpp:107-111
for (const auto &File : Files)
+ if (std::error_code EC = llvm::sys::fs::remove(File.getKey()))
+ llvm::report_fatal_error("failed removing file \"" + File.getKey() + "\": " + EC.message());
> Clangd uses `PrecompiledPreamble` but not `TemporaryFiles` as far as I can tell. `report_fatal_error` can be really disruptive for clangd, so it would be good to get an opinion from somebody working on it if this change would impact them.
Since client code in general might have different error handling/reporting strategy and can't do much about failure in destructor here, I'd consider just some kind of logging or assert here.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits