Skip to content

Commit d2c18b5

Browse files
committed
[NFC][llvm-objcopy] Fix redundant config checks.
The check for unsupported options checks some configs twice in a || expression. Fixes PR47107.
1 parent 0dc5e0c commit d2c18b5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj) {
311311
Config.ExtractDWO || Config.LocalizeHidden || Config.PreserveDates ||
312312
Config.StripAllGNU || Config.StripDWO || Config.StripNonAlloc ||
313313
Config.StripSections || Config.Weaken || Config.DecompressDebugSections ||
314-
Config.StripNonAlloc || Config.StripSections || Config.StripUnneeded ||
315-
Config.DiscardMode == DiscardType::Locals ||
314+
Config.StripUnneeded || Config.DiscardMode == DiscardType::Locals ||
316315
!Config.SymbolsToAdd.empty() || Config.EntryExpr) {
317316
return createStringError(llvm::errc::invalid_argument,
318317
"option not supported by llvm-objcopy for MachO");

0 commit comments

Comments
 (0)