[PATCH] D64165: [llvm-objdump] Keep warning for --disassemble-functions in correct order.
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 14:54:20 PDT 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL365564: [llvm-objdump] Keep warning for --disassemble-functions in correct order. (authored by yuanfang, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D64165?vs=208433&id=208823#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64165/new/
https://reviews.llvm.org/D64165
Files:
llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
===================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
+++ llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
@@ -1,5 +1,10 @@
## Warn if --disassemble-functions specifies an unknown symbol.
-# RUN: yaml2obj %s | llvm-objdump - --disassemble-functions=foo 2>&1 | FileCheck %s
+
+# RUN: yaml2obj -o %t.o %s
+# RUN: rm -f %t.a
+# RUN: llvm-ar qc %t.a %t.o %t.o
+# RUN: llvm-objdump --disassemble-functions=foo %t.o 2>&1 | FileCheck %s
+# RUN: llvm-objdump --disassemble-functions=foo %t.a 2>&1 | FileCheck %s --check-prefix=MULTI
--- !ELF
FileHeader:
@@ -9,3 +14,8 @@
Machine: EM_X86_64
# CHECK: warning: failed to disassemble missing function foo
+
+# MULTI: file format ELF64-x86-64
+# MULTI: warning: failed to disassemble missing function foo
+# MULTI: file format ELF64-x86-64
+# MULTI: warning: failed to disassemble missing function foo
Index: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
@@ -386,8 +386,12 @@
errs().flush();
}
-void warn(Twine Message) {
+static void warn(Twine Message) {
+ // Output order between errs() and outs() matters especially for archive
+ // files where the output is per member object.
+ outs().flush();
WithColor::warning(errs(), ToolName) << Message << "\n";
+ errs().flush();
}
LLVM_ATTRIBUTE_NORETURN void report_error(StringRef File, Twine Message) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64165.208823.patch
Type: text/x-patch
Size: 1671 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190709/46ac81d7/attachment.bin>
More information about the llvm-commits
mailing list