- const InstrProfValueData *VDataPtr =
- getValueData(swap(Data->Values) + NumVSites);
- for (uint32_t Kind = IPVK_First; Kind <= ValueKindLast; ++Kind) {
- NumVSites = swap(Data->NumValueSites[Kind]);
- Record.reserveSites(Kind, NumVSites);
- for (uint32_t VSite = 0; VSite < NumVSites; ++VSite) {
-
- uint32_t VDataCount = VDataCounts[VSite];
- if ((const char *)(VDataPtr + VDataCount) > ProfileEnd)
- return error(instrprof_error::malformed);
-
- std::vector<InstrProfValueData> CurrentValues;
- CurrentValues.reserve(VDataCount);
- for (uint32_t VIndex = 0; VIndex < VDataCount; ++VIndex) {
- uint64_t TargetValue = swap(VDataPtr->Value);
- uint64_t Count = swap(VDataPtr->Count);
- CurrentValues.push_back({TargetValue, Count});
- ++VDataPtr;
- }
- Record.addValueData(Kind, VSite, CurrentValues.data(),
- VDataCount, &FunctionPtrToNameMap);
- }
- }