[llvm] [perf2bolt] Improve heuristic to map in-process addresses to specific… (PR #109397)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 20 02:47:45 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 ccc4fa18423f097a9f04d3198cacf094445ffd71 74fe936b39190263fa1dcb199cb2e9d82a306f2c --extensions cpp,h -- bolt/include/bolt/Core/BinaryContext.h bolt/lib/Core/BinaryContext.cpp bolt/lib/Profile/DataAggregator.cpp bolt/lib/Rewrite/RewriteInstance.cpp bolt/unittests/Core/BinaryContext.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index fb73890d6e..08ce892054 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -71,16 +71,14 @@ struct SegmentInfo {
uint64_t FileOffset; /// Offset in the file.
uint64_t FileSize; /// Size in file.
uint64_t Alignment; /// Alignment of the segment.
- bool IsExecutable; /// Is the executable bit set on the Segment?
+ bool IsExecutable; /// Is the executable bit set on the Segment?
void print(raw_ostream &OS) const {
- OS << "SegmentInfo { Address: 0x"
- << Twine::utohexstr(Address) << ", Size: 0x"
- << Twine::utohexstr(Size) << ", FileOffset: 0x"
+ OS << "SegmentInfo { Address: 0x" << Twine::utohexstr(Address)
+ << ", Size: 0x" << Twine::utohexstr(Size) << ", FileOffset: 0x"
<< Twine::utohexstr(FileOffset) << ", FileSize: 0x"
<< Twine::utohexstr(FileSize) << ", Alignment: 0x"
- << Twine::utohexstr(Alignment)
- << ", " << (IsExecutable?"x":" ")
+ << Twine::utohexstr(Alignment) << ", " << (IsExecutable ? "x" : " ")
<< "}";
};
};
diff --git a/bolt/unittests/Core/BinaryContext.cpp b/bolt/unittests/Core/BinaryContext.cpp
index 6bbfc0da71..05b898d34a 100644
--- a/bolt/unittests/Core/BinaryContext.cpp
+++ b/bolt/unittests/Core/BinaryContext.cpp
@@ -160,7 +160,8 @@ TEST_P(BinaryContextTester, FlushPendingRelocJUMP26) {
TEST_P(BinaryContextTester, BaseAddress) {
// Check that base address calculation is correct for a binary with the
// following segment layout:
- BC->SegmentMapInfo[0] = SegmentInfo{0, 0x10e8c2b4, 0, 0x10e8c2b4, 0x1000, true};
+ BC->SegmentMapInfo[0] =
+ SegmentInfo{0, 0x10e8c2b4, 0, 0x10e8c2b4, 0x1000, true};
BC->SegmentMapInfo[0x10e8d2b4] =
SegmentInfo{0x10e8d2b4, 0x3952faec, 0x10e8c2b4, 0x3952faec, 0x1000, true};
BC->SegmentMapInfo[0x4a3bddc0] =
``````````
</details>
https://github.com/llvm/llvm-project/pull/109397
More information about the llvm-commits
mailing list