[PATCH] D58316: [llvm-objcopy][NFC] More error cleanup

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 18 07:26:58 PST 2019


jhenderson added a comment.

I guess this is okay, but I'm wondering if it's gone too far? The majority of cases you've changed here are in the driver layer, so wouldn't likely ever be librarified. What's the motivation for this round?



================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:224
+    return createStringError(errc::invalid_argument,
+                             "Invalid architecture: '%s'.", Arch.str().c_str());
   return Iter->getValue();
----------------
You've added an extra '.' at the end of this error message. I think our standard is (usually) to not have them. (We might want to tidy up the other messages that do have them already).


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:242
+    return createStringError(errc::invalid_argument,
+                             "Invalid output format: '%s'.",
+                             Format.str().c_str());
----------------
Ditto.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:355
+        errc::invalid_argument,
+        "--target cannot be used with --input-target or --output-target.");
 
----------------
New full stop?


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:370
+          errc::invalid_argument,
+          "Specified binary input without specifiying an architecture.");
+    Expected<const MachineInfo &> MI = getMachineInfo(BinaryArch);
----------------
Ditto


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:398
+            errc::invalid_argument,
+            "Invalid or unsupported --compress-debug-sections format: %s.",
+            InputArgs.getLastArgValue(OBJCOPY_compress_debug_sections_eq)
----------------
Ditto.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:464
+          errc::invalid_argument,
+          "--set-section-flags=%s conflicts with --rename-section=%s=%s.",
+          SR.OriginalName.str().c_str(), SR.OriginalName.str().c_str(),
----------------
Ditto.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:470
+          errc::invalid_argument,
+          "--set-section-flags=%s conflicts with --rename-section=%s=%s.",
+          SR.NewName.str().c_str(), SR.OriginalName.str().c_str(),
----------------
Ditto.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:554
+        "Cannot specify --compress-debug-sections at the same time as "
+        "--decompress-debug-sections at the same time.");
   }
----------------
Ditto.


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:604
+        errc::invalid_argument,
+        "Multiple input files cannot be used in combination with -o.");
 
----------------
Ditto.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58316





More information about the llvm-commits mailing list