mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Don't use StringRef iterator functions for data access
And also remove some redundant casts from r212371. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e45100f420
commit
1a5e5e3814
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user