This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy][NFC] extract arg parsing logic to function
ClosedPublic

Authored by keith on Oct 19 2020, 10:10 AM.

Details

Summary

This reduces a duplicate condition on tool type and removes a deeply
nested ternary.

Author: Keith Smiley <keithbsmiley@gmail.com>

Diff Detail

Event Timeline

keith created this revision.Oct 19 2020, 10:10 AM
keith requested review of this revision.Oct 19 2020, 10:10 AM
jhenderson accepted this revision.Oct 20 2020, 1:21 AM

Looks good, with one suggestion.

Also, couple of notes about the summary:

  1. Add [NFC] to the summary, as there is no functional change caused by this patch.
  2. Tags tend to be in the form [llvm-objcopy] etc.
llvm/tools/llvm-objcopy/llvm-objcopy.cpp
335–336

Can you delete this enum too?

This revision is now accepted and ready to land.Oct 20 2020, 1:21 AM
keith retitled this revision from llvm-objcopy: extract arg parsing logic to function to [llvm-objcopy] extract arg parsing logic to function.Oct 20 2020, 8:30 AM
keith edited the summary of this revision. (Show Details)
keith updated this revision to Diff 299372.Oct 20 2020, 8:32 AM

Remove unused enum

keith marked an inline comment as done.Oct 20 2020, 8:32 AM

Thanks!

llvm/tools/llvm-objcopy/llvm-objcopy.cpp
66

nit: static (since this function is not used outside o llvm-objcopy.cpp)

Looks good, with one suggestion.

Also, couple of notes about the summary:

  1. Add [NFC] to the summary, as there is no functional change caused by this patch.
  2. Tags tend to be in the form [llvm-objcopy] etc.

Summary == patch/commit title, i.e. the full title should be "[llvm-objcopy][NFC] extract arg parsing logic to function" (or something like that).

keith retitled this revision from [llvm-objcopy] extract arg parsing logic to function to [llvm-objcopy][NFC] extract arg parsing logic to function.Oct 21 2020, 9:20 AM
keith edited the summary of this revision. (Show Details)
keith updated this revision to Diff 299720.Oct 21 2020, 9:22 AM
keith marked an inline comment as done.

Make function static

This revision was landed with ongoing or failed builds.Oct 22 2020, 11:33 PM
This revision was automatically updated to reflect the committed changes.