[llvm-objcopy][NFC] More error cleanup
Summary:
This removes calls to `error()`/`reportError()` in the main driver (llvm-objcopy.cpp) as well as the associated argv-parsing (CopyConfig.cpp). `logAllUnhandledErrors()` is now the main way to print errors.
There are still a few uses from within the per-arch drivers, so we can't delete them yet... but almost!
Reviewers: jhenderson, alexshap, espindola
Reviewed By: jhenderson
Subscribers: emaste, arichardson, jakehehrlich, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58316
llvm-svn: 354600
diff --git a/llvm/test/tools/llvm-objcopy/ELF/bad-output-format.test b/llvm/test/tools/llvm-objcopy/ELF/bad-output-format.test
index e01d955..f190a16 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/bad-output-format.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/bad-output-format.test
@@ -10,4 +10,4 @@
Type: ET_EXEC
Machine: EM_386
-# BAD-OUTPUT-FORMAT: Invalid output format: 'xyz'.
+# BAD-OUTPUT-FORMAT: Invalid output format: 'xyz'
diff --git a/llvm/test/tools/llvm-objcopy/ELF/binary-input-error.test b/llvm/test/tools/llvm-objcopy/ELF/binary-input-error.test
index 820e569..4b7736e 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/binary-input-error.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/binary-input-error.test
@@ -6,5 +6,5 @@
# RUN: not llvm-objcopy -I binary -B xyz %t.txt %t.o 2>&1 \
# RUN: | FileCheck %s --check-prefix=BAD-BINARY-ARCH
-# MISSING-BINARY-ARCH: Specified binary input without specifiying an architecture.
-# BAD-BINARY-ARCH: Invalid architecture: 'xyz'.
+# MISSING-BINARY-ARCH: Specified binary input without specifiying an architecture
+# BAD-BINARY-ARCH: Invalid architecture: 'xyz'
diff --git a/llvm/test/tools/llvm-objcopy/ELF/compress-and-decompress-debug-sections-error.test b/llvm/test/tools/llvm-objcopy/ELF/compress-and-decompress-debug-sections-error.test
index 0866e20..aac9bb3 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/compress-and-decompress-debug-sections-error.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/compress-and-decompress-debug-sections-error.test
@@ -3,5 +3,5 @@
# RUN: yaml2obj %p/Inputs/compress-debug-sections.yaml -o %t.o
# RUN: not llvm-objcopy --compress-debug-sections=zlib --decompress-debug-sections %t.o 2>&1 | FileCheck %s
-# CHECK: Cannot specify --compress-debug-sections at the same time as --decompress-debug-sections at the same time.
+# CHECK: Cannot specify --compress-debug-sections at the same time as --decompress-debug-sections at the same time
diff --git a/llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-invalid-format.test b/llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-invalid-format.test
index 854dfe2..8aa8ab4 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-invalid-format.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/compress-debug-sections-invalid-format.test
@@ -1,5 +1,5 @@
# RUN: yaml2obj %p/Inputs/compress-debug-sections.yaml -o %t.o
# RUN: not llvm-objcopy --compress-debug-sections=zlib-fake %t.o 2>&1 | FileCheck %s
-# CHECK: Invalid or unsupported --compress-debug-sections format: zlib-fake.
+# CHECK: Invalid or unsupported --compress-debug-sections format: zlib-fake
diff --git a/llvm/test/tools/llvm-objcopy/ELF/input-output-target.test b/llvm/test/tools/llvm-objcopy/ELF/input-output-target.test
index 7a7df9f..0661aca 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/input-output-target.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/input-output-target.test
@@ -19,4 +19,4 @@
# RUN: %t.txt %t.4.txt 2>&1 \
# RUN: | FileCheck %s --check-prefix=BAD-FLAG
-# BAD-FLAG: --target cannot be used with --input-target or --output-target.
+# BAD-FLAG: --target cannot be used with --input-target or --output-target
diff --git a/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test b/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
index 75f35af..3215f4a 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/rename-section-flag.test
@@ -57,4 +57,4 @@
# WRITE-NEXT: SHF_WRITE (0x1)
# CHECK-NEXT: ]
-# BAD-FLAG: Unrecognized section flag 'xyzzy'. Flags supported for GNU compatibility: alloc, load, noload, readonly, debug, code, data, rom, share, contents, merge, strings.
+# BAD-FLAG: Unrecognized section flag 'xyzzy'. Flags supported for GNU compatibility: alloc, load, noload, readonly, debug, code, data, rom, share, contents, merge, strings
diff --git a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test
index 88f7243..15ea3ae 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags-and-rename.test
@@ -10,5 +10,5 @@
Type: ET_REL
Machine: EM_X86_64
-# SET-FOO: --set-section-flags=.foo conflicts with --rename-section=.foo=.bar.
-# SET-BAR: --set-section-flags=.bar conflicts with --rename-section=.foo=.bar.
+# SET-FOO: --set-section-flags=.foo conflicts with --rename-section=.foo=.bar
+# SET-BAR: --set-section-flags=.bar conflicts with --rename-section=.foo=.bar
diff --git a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
index 6fde33e..3af3f1b 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/set-section-flags.test
@@ -65,4 +65,4 @@
# BAD-FORMAT: Bad format for --set-section-flags: missing '='
# MULTIPLE-SETS: --set-section-flags set multiple times for section .foo
-# BAD-FLAG: Unrecognized section flag 'xyzzy'. Flags supported for GNU compatibility: alloc, load, noload, readonly, debug, code, data, rom, share, contents, merge, strings.
+# BAD-FLAG: Unrecognized section flag 'xyzzy'. Flags supported for GNU compatibility: alloc, load, noload, readonly, debug, code, data, rom, share, contents, merge, strings
diff --git a/llvm/test/tools/llvm-objcopy/ELF/strip-multiple-files.test b/llvm/test/tools/llvm-objcopy/ELF/strip-multiple-files.test
index 9aef872..dcbd57e 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/strip-multiple-files.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/strip-multiple-files.test
@@ -72,4 +72,4 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-# BAD-O-FLAG: Multiple input files cannot be used in combination with -o.
+# BAD-O-FLAG: Multiple input files cannot be used in combination with -o