diff --git a/include/llvm/Object/ELF.h b/include/llvm/Object/ELF.h index 94420d1c568..87a8b7af1b1 100644 --- a/include/llvm/Object/ELF.h +++ b/include/llvm/Object/ELF.h @@ -42,9 +42,8 @@ StringRef getELFRelocationTypeName(uint32_t Machine, uint32_t Type); inline std::pair 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 @@ -233,7 +232,7 @@ private: StringRef Buf; const uint8_t *base() const { - return reinterpret_cast(Buf.begin()); + return reinterpret_cast(Buf.data()); } const Elf_Ehdr *Header;