summaryrefslogtreecommitdiffstats
path: root/lld/Common/ErrorHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/Common/ErrorHandler.cpp')
-rw-r--r--lld/Common/ErrorHandler.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp
index 91ea6799907..b6066b557cb 100644
--- a/lld/Common/ErrorHandler.cpp
+++ b/lld/Common/ErrorHandler.cpp
@@ -56,9 +56,10 @@ void lld::exitLld(int val) {
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
- // build allows us to get the output of -time-passes.
+ // Dealloc/destroy ManagedStatic variables before calling _exit().
+ // In an LTO build, allows us to get the output of -time-passes.
+ // Ensures that the thread pool for the parallel algorithms is stopped to
+ // avoid intermittent crashes on Windows when exiting.
llvm_shutdown();
lld::outs().flush();
OpenPOWER on IntegriCloud