diff --git a/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp b/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp index de372ac0d1383..fff3f01a60f41 100644 --- a/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp +++ b/llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp @@ -215,7 +215,7 @@ static Error processLoadCommands(const CopyConfig &Config, Object &Obj) { "rpath " + RPath + " would create a duplicate load command"); RPaths.insert(RPath); - Obj.addLoadCommand(buildRPathLoadCommand(RPath)); + Obj.LoadCommands.push_back(buildRPathLoadCommand(RPath)); } return Error::success(); diff --git a/llvm/tools/llvm-objcopy/MachO/Object.cpp b/llvm/tools/llvm-objcopy/MachO/Object.cpp index de8cb0af108d7..0359e2a3e9244 100644 --- a/llvm/tools/llvm-objcopy/MachO/Object.cpp +++ b/llvm/tools/llvm-objcopy/MachO/Object.cpp @@ -111,10 +111,6 @@ Error Object::removeSections( return Error::success(); } -void Object::addLoadCommand(LoadCommand LC) { - LoadCommands.push_back(std::move(LC)); -} - template static void constructSegment(SegmentType &Seg, llvm::MachO::LoadCommandType CmdType, diff --git a/llvm/tools/llvm-objcopy/MachO/Object.h b/llvm/tools/llvm-objcopy/MachO/Object.h index e825d1867b09a..102aeedc292fb 100644 --- a/llvm/tools/llvm-objcopy/MachO/Object.h +++ b/llvm/tools/llvm-objcopy/MachO/Object.h @@ -331,8 +331,6 @@ struct Object { void updateLoadCommandIndexes(); - void addLoadCommand(LoadCommand LC); - /// Creates a new segment load command in the object and returns a reference /// to the newly created load command. The caller should verify that SegName /// is not too long (SegName.size() should be less than or equal to 16).