[lld] r323725 - [COFF] Remove the temporary file if not updating the import library
Martin Storsjo via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 23:26:01 PST 2018
Author: mstorsjo
Date: Mon Jan 29 23:26:01 2018
New Revision: 323725
URL: http://llvm.org/viewvc/llvm-project?rev=323725&view=rev
Log:
[COFF] Remove the temporary file if not updating the import library
Differential Revision: https://reviews.llvm.org/D42621
Modified:
lld/trunk/COFF/Driver.cpp
Modified: lld/trunk/COFF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Driver.cpp?rev=323725&r1=323724&r2=323725&view=diff
==============================================================================
--- lld/trunk/COFF/Driver.cpp (original)
+++ lld/trunk/COFF/Driver.cpp Mon Jan 29 23:26:01 2018
@@ -572,6 +572,8 @@ static void createImportLibrary(bool AsL
if ((*OldBuf)->getBuffer() != NewBuf->getBuffer()) {
OldBuf->reset();
HandleError(errorCodeToError(sys::fs::rename(TmpName, Path)));
+ } else {
+ sys::fs::remove(TmpName);
}
}
More information about the llvm-commits
mailing list