diff options
| author | Martin Storsjo <martin@martin.st> | 2018-08-24 18:36:42 +0000 |
|---|---|---|
| committer | Martin Storsjo <martin@martin.st> | 2018-08-24 18:36:42 +0000 |
| commit | 0f3d8e236043f71962adbaab13f73b05a38a3efc (patch) | |
| tree | dc1bc52238ab6ef2aa576b57f1838e528a80aed6 | |
| parent | 4153e9fbb1562d765297fec58e903345c9f165c3 (diff) | |
| download | bcm5719-llvm-0f3d8e236043f71962adbaab13f73b05a38a3efc.tar.gz bcm5719-llvm-0f3d8e236043f71962adbaab13f73b05a38a3efc.zip | |
[Common] Discard the temp file while keeping the memory mapping open, on errors
Differential Revision: https://reviews.llvm.org/D51095
llvm-svn: 340635
| -rw-r--r-- | lld/Common/ErrorHandler.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp index d1cb3dbbe03..c059516daf9 100644 --- a/lld/Common/ErrorHandler.cpp +++ b/lld/Common/ErrorHandler.cpp @@ -47,8 +47,9 @@ ErrorHandler &lld::errorHandler() { } void lld::exitLld(int Val) { - // Delete the output buffer so that any tempory file is deleted. - errorHandler().OutputBuffer.reset(); + // Delete any temporary file, while keeping the memory mapping open. + if (errorHandler().OutputBuffer) + errorHandler().OutputBuffer->discard(); // Dealloc/destroy ManagedStatic variables before calling // _exit(). In a non-LTO build, this is a nop. In an LTO |

