diff options
| author | Alp Toker <alp@nuanti.com> | 2014-07-06 10:32:55 +0000 |
|---|---|---|
| committer | Alp Toker <alp@nuanti.com> | 2014-07-06 10:32:55 +0000 |
| commit | 54cc62740f8abe1ac69c664e006c22bea5c4957b (patch) | |
| tree | f2d06a85353bc1fe57f867ef006f8010a56d2a2e | |
| parent | 452bfcf00cb5fd3fad31c9aefdc6f3b775ff2748 (diff) | |
| download | bcm5719-llvm-54cc62740f8abe1ac69c664e006c22bea5c4957b.tar.gz bcm5719-llvm-54cc62740f8abe1ac69c664e006c22bea5c4957b.zip | |
Don't use StringRef iterator functions for data access
And also remove some redundant casts from r212371.
llvm-svn: 212397
| -rw-r--r-- | llvm/include/llvm/Object/ELF.h | 7 |
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; |

