From 97e61228e0502a7cbab6a014182303db74fa80be Mon Sep 17 00:00:00 2001 From: Jordan Rupprecht Date: Tue, 11 Aug 2020 10:37:19 -0700 Subject: [PATCH] [NFC][llvm-objcopy] Fix redundant config checks. The check for unsupported options checks some configs twice in a || expression. Fixes PR47107. --- tools/llvm-objcopy/MachO/MachOObjcopy.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/llvm-objcopy/MachO/MachOObjcopy.cpp b/tools/llvm-objcopy/MachO/MachOObjcopy.cpp index 5ca5b133572..68cbdbbf6be 100644 --- a/tools/llvm-objcopy/MachO/MachOObjcopy.cpp +++ b/tools/llvm-objcopy/MachO/MachOObjcopy.cpp @@ -311,8 +311,7 @@ static Error handleArgs(const CopyConfig &Config, Object &Obj) { Config.ExtractDWO || Config.LocalizeHidden || Config.PreserveDates || Config.StripAllGNU || Config.StripDWO || Config.StripNonAlloc || Config.StripSections || Config.Weaken || Config.DecompressDebugSections || - Config.StripNonAlloc || Config.StripSections || Config.StripUnneeded || - Config.DiscardMode == DiscardType::Locals || + Config.StripUnneeded || Config.DiscardMode == DiscardType::Locals || !Config.SymbolsToAdd.empty() || Config.EntryExpr) { return createStringError(llvm::errc::invalid_argument, "option not supported by llvm-objcopy for MachO");