[PATCH] D63239: [llvm-objcopy][NFC] Refactor output target parsing
Seiya Nuta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 17 19:26:29 PDT 2019
seiya added inline comments.
================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:457-462
+ if (InputFormat.empty())
+ Config.InputFormat = FileFormat::Unspecified;
+ else if (InputFormat == "ihex")
+ Config.InputFormat = FileFormat::IHex;
+ else if (InputFormat == "binary") {
+ Config.InputFormat = FileFormat::Binary;
----------------
rupprecht wrote:
> This should use a `StringSwitch`
>
> (I suppose adding an `Unrecognized` file format type to handle the 'else' part?)
I think we don't need `Unrecognized` for now because currently we simply ignore unrecognized input formats and guess the file format by `createBinary`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63239/new/
https://reviews.llvm.org/D63239
More information about the llvm-commits
mailing list