[llvm] [BOLT] Heatmap fix on large binaries and printing mappings (PR #92815)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 20 12:48:56 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 097e96d0d1ad9cceb461bb3487af0a2ec42176e4 c74aaf40b6e838e0ea633bea63f2899039367b57 -- bolt/lib/Profile/DataAggregator.cpp bolt/lib/Profile/Heatmap.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/bolt/lib/Profile/DataAggregator.cpp b/bolt/lib/Profile/DataAggregator.cpp
index 8d5b553165..33c0d666d9 100644
--- a/bolt/lib/Profile/DataAggregator.cpp
+++ b/bolt/lib/Profile/DataAggregator.cpp
@@ -2070,13 +2070,13 @@ std::error_code DataAggregator::parseMMapEvents() {
// The mapping was already in place, but there are cases where the size
// is wrong. Fix it if needed.
- if(!BinaryMMapInfo.insert(std::make_pair(MMapInfo.PID, MMapInfo)).second) {
+ if (!BinaryMMapInfo.insert(std::make_pair(MMapInfo.PID, MMapInfo)).second) {
auto EndAddress = MMapInfo.MMapAddress + MMapInfo.Size;
auto FixedSize = EndAddress - BinaryMMapInfo[MMapInfo.PID].BaseAddress;
if (FixedSize != BinaryMMapInfo[MMapInfo.PID].Size) {
- outs() << "MMap size fixed: " << Twine::utohexstr(FixedSize) << " \n";
- BinaryMMapInfo[MMapInfo.PID].Size = FixedSize;
+ outs() << "MMap size fixed: " << Twine::utohexstr(FixedSize) << " \n";
+ BinaryMMapInfo[MMapInfo.PID].Size = FixedSize;
}
}
}
diff --git a/bolt/lib/Profile/Heatmap.cpp b/bolt/lib/Profile/Heatmap.cpp
index 233b070bde..47e6d07616 100644
--- a/bolt/lib/Profile/Heatmap.cpp
+++ b/bolt/lib/Profile/Heatmap.cpp
@@ -179,7 +179,7 @@ void Heatmap::print(raw_ostream &OS) const {
int Idx = 0;
for (auto TxtSeg : TextSections) {
OS << static_cast<char>('A' + ((Idx++) % 26)) << ": " << TxtSeg.Name
- << ": 0x" << Twine::utohexstr(TxtSeg.BeginAddress) << "-0x"
+ << ": 0x" << Twine::utohexstr(TxtSeg.BeginAddress) << "-0x"
<< Twine::utohexstr(TxtSeg.EndAddress) << "\n";
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/92815
More information about the llvm-commits
mailing list