[llvm-objcopy] Fix "unused-function" warning in NDEBUG builds

Fixup of commit b925ca37a8 to allow building with
-Werror -Wunused-function.
This commit is contained in:
Bjorn Pettersson 2020-06-29 16:56:35 +02:00
parent e22cae32c5
commit cc836950ab
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ using namespace object;
using SectionPred = std::function<bool(const std::unique_ptr<Section> &Sec)>;
using LoadCommandPred = std::function<bool(const LoadCommand &LC)>;
#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 @@ static bool isLoadCommandWithPayloadString(const LoadCommand &LC) {
LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_DYLIB ||
LC.MachOLoadCommand.load_command_data.cmd == MachO::LC_LOAD_WEAK_DYLIB;
}
#endif
static StringRef getPayloadString(const LoadCommand &LC) {
assert(isLoadCommandWithPayloadString(LC) &&