summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Object/ELF.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 94420d1c568..87a8b7af1b1 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -42,9 +42,8 @@ StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type);
inline std::pair<unsigned char, unsigned char>
getElfArchType(StringRef Object) {
if (Object.size() < ELF::EI_NIDENT)
- return std::make_pair((uint8_t)ELF::ELFCLASSNONE,(uint8_t)ELF::ELFDATANONE);
- return std::make_pair((uint8_t)Object.begin()[ELF::EI_CLASS],
- (uint8_t)Object.begin()[ELF::EI_DATA]);
+ return std::make_pair(ELF::ELFCLASSNONE, ELF::ELFDATANONE);
+ return std::make_pair(Object[ELF::EI_CLASS], Object[ELF::EI_DATA]);
}
template <class ELFT>
@@ -233,7 +232,7 @@ private:
StringRef Buf;
const uint8_t *base() const {
- return reinterpret_cast<const uint8_t *>(Buf.begin());
+ return reinterpret_cast<const uint8_t *>(Buf.data());
}
const Elf_Ehdr *Header;
OpenPOWER on IntegriCloud