[PATCH] D64165: [llvm-objdump] Keep warning for --disassemble-functions in correct order.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 00:12:05 PDT 2019
MaskRay added a comment.
LG. A few nits below:
================
Comment at: llvm/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test:6
+# RUN: rm -f %t.a
+# RUN: llvm-ar rc %t.a %t.1.o %t.2.o
+# RUN: llvm-objdump --disassemble-functions=foo %t.1.o 2>&1 | FileCheck %s
----------------
```
yaml2obj -o %t.o %s
rm -f %t.a
llvm-ar qc %t.a %t.o %t.o
```
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:384
-void warn(Twine Message) {
- WithColor::warning(errs(), ToolName) << Message << "\n";
+static void warn(Twine Message, StringRef Prefix = "") {
+ // Output order between errs() and outs() matters especially for archive
----------------
Why was `StringRef Prefix` added? It does not seem to be used.
================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:389
+ WithColor::warning(errs(), Prefix) << Message << "\n";
+ errs().flush();
}
----------------
This is probably redundant. stderr is by default unbuffered. If the user makes it buffered, they should be prepared to see out-of-order output.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64165/new/
https://reviews.llvm.org/D64165
More information about the llvm-commits
mailing list