diff --git a/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp b/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp --- a/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp @@ -22,6 +22,7 @@ using SectionPred = std::function &Sec)>; using LoadCommandPred = std::function; +#ifndef NDEBUG static bool isLoadCommandWithPayloadString(const LoadCommand &LC) { // TODO: Add support for LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB and // LC_LAZY_LOAD_DYLIB @@ -30,6 +31,7 @@ LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_DYLIB || LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_WEAK_DYLIB; } +#endif static StringRef getLoadCommandPayloadString(const LoadCommand &LC) { assert(isLoadCommandWithPayloadString(LC) &&