From 2f6d00612d62c0da948145574c396c53543e21f4 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 17 Apr 2018 01:54:34 +0000 Subject: COFF: Make SectionChunk::Relocs field an ArrayRef. NFCI. Differential Revision: https://reviews.llvm.org/D45714 llvm-svn: 330172 --- llvm/lib/Object/COFFObjectFile.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'llvm/lib/Object/COFFObjectFile.cpp') diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp index e45246b5776..ab4cc60cbc2 100644 --- a/llvm/lib/Object/COFFObjectFile.cpp +++ b/llvm/lib/Object/COFFObjectFile.cpp @@ -1147,13 +1147,10 @@ COFFObjectFile::getCOFFRelocation(const RelocationRef &Reloc) const { return toRel(Reloc.getRawDataRefImpl()); } -iterator_range +ArrayRef COFFObjectFile::getRelocations(const coff_section *Sec) const { - const coff_relocation *I = getFirstReloc(Sec, Data, base()); - const coff_relocation *E = I; - if (I) - E += getNumberOfRelocations(Sec, Data, base()); - return make_range(I, E); + return {getFirstReloc(Sec, Data, base()), + getNumberOfRelocations(Sec, Data, base())}; } #define LLVM_COFF_SWITCH_RELOC_TYPE_NAME(reloc_type) \ -- cgit v1.2.3