[lld] [ELF] Add context-aware diagnostic functions (PR #112319)

Vy Nguyen via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 07:58:38 PDT 2024


================
@@ -335,3 +335,21 @@ void ErrorHandler::fatal(const Twine &msg) {
   error(msg);
   exitLld(1);
 }
+
+SyncStream::~SyncStream() {
+  os.flush();
+  switch (level) {
+  case DiagLevel::Log:
+    e.log(buf);
----------------
oontvoo wrote:

I wonder if it'd be helpful to have the log-msg logged instantly to the handler rather than waiting till the end?
(The messages might get dropped if lld crashed before the dtor gets to run?)

https://github.com/llvm/llvm-project/pull/112319


More information about the llvm-commits mailing list