[PATCH] D80803: [llvm-dwarfdump] Flush output before warning and errors are reported

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 14:05:53 PDT 2020


MaskRay added a comment.

I also think this approach is scalable.



================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test:54
 # RESERVED-NOT: prologue
-# RESERVED: warning: parsing line table prologue at offset 0x00000048: unsupported reserved unit length of value 0xfffffffe
+# RESERVED:     warning: parsing line table prologue at offset 0x00000048: unsupported reserved unit length of value 0xfffffffe
 # RESERVED-NOT: prologue
----------------
Unneeded change after your other change landed?


================
Comment at: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:506
+    // more output is printed.
+    errs().flush();
+  };
----------------
`errs().flush()` can be deleted. stderr is not buffered. I requested this in the llvm-objdump patch when ychen added it, staging that there were two other instances. The two other instances seems to have gone, so I deleted `errs().flush()` as well yesterday.

If a user explicitly makes stderr buffered (via setvbuf), they should accept strangely interleaved streams.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80803/new/

https://reviews.llvm.org/D80803





More information about the llvm-commits mailing list