summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Object/COFF.h3
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp9
2 files changed, 4 insertions, 8 deletions
diff --git a/llvm/include/llvm/Object/COFF.h b/llvm/include/llvm/Object/COFF.h
index 9190149f382..99048abfdb3 100644
--- a/llvm/include/llvm/Object/COFF.h
+++ b/llvm/include/llvm/Object/COFF.h
@@ -1012,8 +1012,7 @@ public:
llvm_unreachable("null symbol table pointer!");
}
- iterator_range<const coff_relocation *>
- getRelocations(const coff_section *Sec) const;
+ ArrayRef<coff_relocation> getRelocations(const coff_section *Sec) const;
std::error_code getSectionName(const coff_section *Sec, StringRef &Res) const;
uint64_t getSectionSize(const coff_section *Sec) const;
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<const coff_relocation *>
+ArrayRef<coff_relocation>
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) \
OpenPOWER on IntegriCloud