[lld] r286548 - Call flush() after llvm_shutdown().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 18:16:16 PST 2016


Author: ruiu
Date: Thu Nov 10 20:16:15 2016
New Revision: 286548

URL: http://llvm.org/viewvc/llvm-project?rev=286548&view=rev
Log:
Call flush() after llvm_shutdown().

llvm_shutdown could write something to outs or errs,
so we need to flush them after calling llvm_shutdown.

Modified:
    lld/trunk/ELF/Error.cpp

Modified: lld/trunk/ELF/Error.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Error.cpp?rev=286548&r1=286547&r2=286548&view=diff
==============================================================================
--- lld/trunk/ELF/Error.cpp (original)
+++ lld/trunk/ELF/Error.cpp Thu Nov 10 20:16:15 2016
@@ -49,14 +49,13 @@ void elf::error(std::error_code EC, cons
 }
 
 void elf::exitLld(int Val) {
-  outs().flush();
-  errs().flush();
-
   // 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.
   llvm_shutdown();
 
+  outs().flush();
+  errs().flush();
   _exit(Val);
 }
 




More information about the llvm-commits mailing list