[llvm-branch-commits] [llvm] [BOLT] Map branch source address to the containing basic block in BAT YAML (PR #91273)
Maksim Panchenko via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun May 12 16:49:24 PDT 2024
================
@@ -2378,21 +2379,27 @@ std::error_code DataAggregator::writeBATYAML(BinaryContext &BC,
return CSI;
};
+ // Lookup containing basic block offset and index
+ auto getBlock = [&BlockMap](uint32_t Offset) {
+ auto BlockIt = BlockMap.upper_bound(Offset);
+ if (LLVM_UNLIKELY(BlockIt == BlockMap.begin())) {
+ errs() << "BOLT-ERROR: Invalid BAT section";
----------------
maksfb wrote:
```suggestion
errs() << "BOLT-ERROR: invalid BAT section\n";
```
https://github.com/llvm/llvm-project/pull/91273
More information about the llvm-branch-commits
mailing list