From 6a0746a92f0764f7af1968c84b141ccbe752919c Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 7 Apr 2019 03:58:42 +0000 Subject: Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef() llvm-svn: 357852 --- llvm/lib/ProfileData/InstrProf.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'llvm/lib/ProfileData/InstrProf.cpp') diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index ccb651a22b3..91a3d173111 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -434,9 +434,8 @@ Error collectPGOFuncNameStrings(ArrayRef NameVars, } Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) { - const uint8_t *P = reinterpret_cast(NameStrings.data()); - const uint8_t *EndP = reinterpret_cast(NameStrings.data() + - NameStrings.size()); + const uint8_t *P = NameStrings.bytes_begin(); + const uint8_t *EndP = NameStrings.bytes_end(); while (P < EndP) { uint32_t N; uint64_t UncompressedSize = decodeULEB128(P, &N); -- cgit v1.2.3