diff --git a/llvm/tools/llvm-objcopy/ELF/Object.h b/llvm/tools/llvm-objcopy/ELF/Object.h --- a/llvm/tools/llvm-objcopy/ELF/Object.h +++ b/llvm/tools/llvm-objcopy/ELF/Object.h @@ -48,12 +48,12 @@ struct Symbol; class SectionTableRef { - MutableArrayRef> Sections; + ArrayRef> Sections; public: - using iterator = pointee_iterator *>; + using iterator = pointee_iterator *>; - explicit SectionTableRef(MutableArrayRef> Secs) + explicit SectionTableRef(ArrayRef> Secs) : Sections(Secs) {} SectionTableRef(const SectionTableRef &) = default; @@ -1022,10 +1022,6 @@ }; public: - template - using Range = iterator_range< - pointee_iterator>::iterator>>; - template using ConstRange = iterator_range>::const_iterator>>; @@ -1055,10 +1051,7 @@ SectionIndexSection *SectionIndexTable = nullptr; void sortSections(); - SectionTableRef sections() { return SectionTableRef(Sections); } - ConstRange sections() const { - return make_pointee_range(Sections); - } + SectionTableRef sections() const { return SectionTableRef(Sections); } iterator_range< filter_iterator::const_iterator>, decltype(§ionIsAlloc)>> @@ -1073,7 +1066,6 @@ } SectionTableRef removedSections() { return SectionTableRef(RemovedSections); } - Range segments() { return make_pointee_range(Segments); } ConstRange segments() const { return make_pointee_range(Segments); } Error removeSections(bool AllowBrokenLinks,