[llvm] r365564 - [llvm-objdump] Keep warning for --disassemble-functions in correct order.
Yuanfang Chen via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 14:53:34 PDT 2019
Author: yuanfang
Date: Tue Jul 9 14:53:33 2019
New Revision: 365564
URL: http://llvm.org/viewvc/llvm-project?rev=365564&view=rev
Log:
[llvm-objdump] Keep warning for --disassemble-functions in correct order.
relative to normal output when dumping archive files.
prepare for PR35351.
Reviewers: jhenderson, grimar, MaskRay, rupprecht
Reviewed by: MaskRay, jhenderson
Differential Revision: https://reviews.llvm.org/D64165
Modified:
llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test?rev=365564&r1=365563&r2=365564&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/X86/warn-missing-disasm-func.test Tue Jul 9 14:53:33 2019
@@ -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 @@ FileHeader:
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
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=365564&r1=365563&r2=365564&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Tue Jul 9 14:53:33 2019
@@ -386,8 +386,12 @@ void warn(StringRef Message) {
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) {
More information about the llvm-commits
mailing list