summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData/InstrProf.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-04-07 03:58:42 +0000
committerFangrui Song <maskray@google.com>2019-04-07 03:58:42 +0000
commit6a0746a92f0764f7af1968c84b141ccbe752919c (patch)
tree0ee2b9c51b91d60ec561bc3a6ba11e7a8937c29c /llvm/lib/ProfileData/InstrProf.cpp
parentfca07890a9918e9814a7c3d6a39ea3a91789b546 (diff)
downloadbcm5719-llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.tar.gz
bcm5719-llvm-6a0746a92f0764f7af1968c84b141ccbe752919c.zip
Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()
llvm-svn: 357852
Diffstat (limited to 'llvm/lib/ProfileData/InstrProf.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProf.cpp5
1 files changed, 2 insertions, 3 deletions
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<GlobalVariable *> NameVars,
}
Error readPGOFuncNameStrings(StringRef NameStrings, InstrProfSymtab &Symtab) {
- const uint8_t *P = reinterpret_cast<const uint8_t *>(NameStrings.data());
- const uint8_t *EndP = reinterpret_cast<const uint8_t *>(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);
OpenPOWER on IntegriCloud