Move the implementation of getStringTableBuilderKind into
MachOLayoutBuilder.cpp. NFC.
Test plan: make check-all
namespace objcopy {
namespace macho {
+StringTableBuilder::Kind
+MachOLayoutBuilder::getStringTableBuilderKind(const Object &O, bool Is64Bit) {
+ if (O.Header.FileType == MachO::HeaderFileType::MH_OBJECT)
+ return Is64Bit ? StringTableBuilder::MachO64 : StringTableBuilder::MachO;
+ return Is64Bit ? StringTableBuilder::MachO64Linked
+ : StringTableBuilder::MachOLinked;
+}
+
uint32_t MachOLayoutBuilder::computeSizeOfCmds() const {
uint32_t Size = 0;
for (const LoadCommand &LC : O.LoadCommands) {
Error layoutTail(uint64_t Offset);
static StringTableBuilder::Kind getStringTableBuilderKind(const Object &O,
- bool Is64Bit) {
- if (O.Header.FileType == MachO::HeaderFileType::MH_OBJECT)
- return Is64Bit ? StringTableBuilder::MachO64 : StringTableBuilder::MachO;
- return Is64Bit ? StringTableBuilder::MachO64Linked
- : StringTableBuilder::MachOLinked;
- }
+ bool Is64Bit);
public:
MachOLayoutBuilder(Object &O, bool Is64Bit, uint64_t PageSize)