From 80b24cf0f0d9b14e92f6918b6a2f6d52da73a07c Mon Sep 17 00:00:00 2001 From: Alexander Shaposhnikov Date: Tue, 29 Jun 2021 01:18:48 -0700 Subject: [PATCH] Revert "[llvm-objcopy][MachO] Minor code cleanup" This reverts commit c94cf97b53566a26245c54ea0c41b0dc83daf8a0 since it appears to have broken linaro-clang-armv7-quick build bot and needs further investigation. --- tools/llvm-objcopy/MachO/MachOReader.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/llvm-objcopy/MachO/MachOReader.cpp b/tools/llvm-objcopy/MachO/MachOReader.cpp index 4b0aeb97026..050dd976f3f 100644 --- a/tools/llvm-objcopy/MachO/MachOReader.cpp +++ b/tools/llvm-objcopy/MachO/MachOReader.cpp @@ -28,7 +28,7 @@ void MachOReader::readHeader(Object &O) const { } template -static Section constructSectionCommon(const SectionType &Sec, uint32_t Index) { +static Section constructSectionCommon(SectionType Sec, uint32_t Index) { StringRef SegName(Sec.segname, strnlen(Sec.segname, sizeof(Sec.segname))); StringRef SectName(Sec.sectname, strnlen(Sec.sectname, sizeof(Sec.sectname))); Section S(SegName, SectName); @@ -46,11 +46,14 @@ static Section constructSectionCommon(const SectionType &Sec, uint32_t Index) { return S; } -static Section constructSection(const MachO::section &Sec, uint32_t Index) { +template +Section constructSection(SectionType Sec, uint32_t Index); + +template <> Section constructSection(MachO::section Sec, uint32_t Index) { return constructSectionCommon(Sec, Index); } -static Section constructSection(const MachO::section_64 &Sec, uint32_t Index) { +template <> Section constructSection(MachO::section_64 Sec, uint32_t Index) { Section S = constructSectionCommon(Sec, Index); S.Reserved3 = Sec.reserved3; return S;