Skip to content

Commit c94cf97

Browse files
author
Alexander Shaposhnikov
committed
[llvm-objcopy][MachO] Minor code cleanup
Remove unnecessary template in MachOReader.cpp. NFC.
1 parent 6d234a6 commit c94cf97

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/tools/llvm-objcopy/MachO/MachOReader.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void MachOReader::readHeader(Object &O) const {
2828
}
2929

3030
template <typename SectionType>
31-
static Section constructSectionCommon(SectionType Sec, uint32_t Index) {
31+
static Section constructSectionCommon(const SectionType &Sec, uint32_t Index) {
3232
StringRef SegName(Sec.segname, strnlen(Sec.segname, sizeof(Sec.segname)));
3333
StringRef SectName(Sec.sectname, strnlen(Sec.sectname, sizeof(Sec.sectname)));
3434
Section S(SegName, SectName);
@@ -46,14 +46,11 @@ static Section constructSectionCommon(SectionType Sec, uint32_t Index) {
4646
return S;
4747
}
4848

49-
template <typename SectionType>
50-
Section constructSection(SectionType Sec, uint32_t Index);
51-
52-
template <> Section constructSection(MachO::section Sec, uint32_t Index) {
49+
static Section constructSection(const MachO::section &Sec, uint32_t Index) {
5350
return constructSectionCommon(Sec, Index);
5451
}
5552

56-
template <> Section constructSection(MachO::section_64 Sec, uint32_t Index) {
53+
static Section constructSection(const MachO::section_64 &Sec, uint32_t Index) {
5754
Section S = constructSectionCommon(Sec, Index);
5855
S.Reserved3 = Sec.reserved3;
5956
return S;

0 commit comments

Comments
 (0)