Skip to content

Commit 5f35795

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.4
1 parent f0d3257 commit 5f35795

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,12 +2279,11 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
22792279
const BoltAddressTranslation::BBHashMapTy &BlockMap =
22802280
BAT->getBBHashMap(FuncAddress);
22812281
YamlBF.Blocks.resize(YamlBF.NumBasicBlocks);
2282+
for (size_t Idx = 0; Idx != YamlBF.NumBasicBlocks; ++Idx)
2283+
YamlBF.Blocks[Idx].Index = Idx;
22822284

2283-
for (auto &&[Entry, YamlBB] : llvm::zip(BlockMap, YamlBF.Blocks)) {
2284-
const auto &Block = Entry.second;
2285-
YamlBB.Hash = Block.Hash;
2286-
YamlBB.Index = Block.Index;
2287-
}
2285+
for (const auto &Block : llvm::make_second_range(BlockMap))
2286+
YamlBF.Blocks[Block.Index].Hash = Block.Hash;
22882287

22892288
// Lookup containing basic block offset and index
22902289
auto getBlock = [&BlockMap](uint32_t Offset) {

0 commit comments

Comments
 (0)