summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ProfileData
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-11-18 22:42:27 +0000
committerXinliang David Li <davidxl@google.com>2015-11-18 22:42:27 +0000
commitcfb1456572949abcbe1769c5c272ce1f397db883 (patch)
treed6a6ac8d8ff1e53047f3b8d27e981c49dbf5fcaa /llvm/lib/ProfileData
parent455ea11d13a1f88d8c5c65f78ef21a81efab8f22 (diff)
downloadbcm5719-llvm-cfb1456572949abcbe1769c5c272ce1f397db883.tar.gz
bcm5719-llvm-cfb1456572949abcbe1769c5c272ce1f397db883.zip
Minor cleanups (from review feedback)
1. remove uneeded header inclusion 2. use reinterpret_cast instead of c ctyle 3. other format change llvm-svn: 253515
Diffstat (limited to 'llvm/lib/ProfileData')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 8a0354dc98c..fe52e1312ef 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -255,7 +255,8 @@ template <class IntPtrT>
std::error_code RawInstrProfReader<IntPtrT>::readName(InstrProfRecord &Record) {
Record.Name = StringRef(getName(Data->NamePtr), swap(Data->NameSize));
if (Record.Name.data() < NamesStart ||
- Record.Name.data() + Record.Name.size() > (char*)ValueDataStart)
+ Record.Name.data() + Record.Name.size() >
+ reinterpret_cast<const char *>(ValueDataStart))
return error(instrprof_error::malformed);
return success();
}
@@ -311,7 +312,8 @@ std::error_code RawInstrProfReader<IntPtrT>::readValueData(
auto VDataCounts = makeArrayRef(getValueDataCounts(Data->Values), NumVSites);
// Check bounds.
if (VDataCounts.data() < ValueDataStart ||
- VDataCounts.data() + VDataCounts.size() > (const uint8_t *)ProfileEnd)
+ VDataCounts.data() + VDataCounts.size() >
+ reinterpret_cast<const uint8_t *>(ProfileEnd))
return error(instrprof_error::malformed);
const InstrProfValueData *VDataPtr =
OpenPOWER on IntegriCloud