summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-08-24 18:36:42 +0000
committerMartin Storsjo <martin@martin.st>2018-08-24 18:36:42 +0000
commit0f3d8e236043f71962adbaab13f73b05a38a3efc (patch)
treedc1bc52238ab6ef2aa576b57f1838e528a80aed6
parent4153e9fbb1562d765297fec58e903345c9f165c3 (diff)
downloadbcm5719-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.cpp5
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
OpenPOWER on IntegriCloud