From 4f18bef9989f82e09069b1452e4c5d3528d66dd6 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Wed, 25 Nov 2015 03:24:37 +0000 Subject: [PATCH] Move member functions closer to others of the same class (NFC) llvm-svn: 254055 --- llvm/lib/ProfileData/InstrProf.cpp | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/llvm/lib/ProfileData/InstrProf.cpp b/llvm/lib/ProfileData/InstrProf.cpp index 86bc436453de..edb0eb9fa39a 100644 --- a/llvm/lib/ProfileData/InstrProf.cpp +++ b/llvm/lib/ProfileData/InstrProf.cpp @@ -143,6 +143,22 @@ uint64_t stringToHash(uint32_t ValueKind, uint64_t Value) { return Value; } +uint32_t ValueProfRecord::getNumValueData() const { + uint32_t NumValueData = 0; + for (uint32_t I = 0; I < NumValueSites; I++) + NumValueData += SiteCountArray[I]; + return NumValueData; +} + +ValueProfRecord *ValueProfRecord::getNext() { + return reinterpret_cast((char *)this + getSize()); +} + +InstrProfValueData *ValueProfRecord::getValueData() { + return reinterpret_cast( + (char *)this + getValueProfRecordHeaderSize(NumValueSites)); +} + void ValueProfRecord::deserializeTo(InstrProfRecord &Record, InstrProfRecord::ValueMapType *VMap) { Record.reserveSites(Kind, NumValueSites); @@ -331,19 +347,5 @@ ValueProfRecord *ValueProfData::getFirstValueProfRecord() { sizeof(ValueProfData)); } -uint32_t ValueProfRecord::getNumValueData() const { - uint32_t NumValueData = 0; - for (uint32_t I = 0; I < NumValueSites; I++) - NumValueData += SiteCountArray[I]; - return NumValueData; } -ValueProfRecord *ValueProfRecord::getNext() { - return reinterpret_cast((char *)this + getSize()); -} - -InstrProfValueData *ValueProfRecord::getValueData() { - return reinterpret_cast( - (char *)this + getValueProfRecordHeaderSize(NumValueSites)); -} -}