mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[LTO] onfig::addSaveTemps: clear ResolutionFile upon an error
Otherwise ld.lld -save-temps will crash when writing to ResolutionFile. llvm-lto2 -save-temps does not crash because it exits immediately. Reviewed By: evgeny777 Differential Revision: https://reviews.llvm.org/D75426
This commit is contained in:
parent
5b890d8e7a
commit
4cdc54cceb
@ -61,8 +61,10 @@ Error Config::addSaveTemps(std::string OutputFileName,
|
||||
std::error_code EC;
|
||||
ResolutionFile = std::make_unique<raw_fd_ostream>(
|
||||
OutputFileName + "resolution.txt", EC, sys::fs::OpenFlags::OF_Text);
|
||||
if (EC)
|
||||
if (EC) {
|
||||
ResolutionFile.reset();
|
||||
return errorCodeToError(EC);
|
||||
}
|
||||
|
||||
auto setHook = [&](std::string PathSuffix, ModuleHookFn &Hook) {
|
||||
// Keep track of the hook provided by the linker, which also needs to run.
|
||||
|
Loading…
Reference in New Issue
Block a user