[llvm] [llvm-readobj] Dump callgraph section info for ELF (PR #157499)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 8 09:00:52 PDT 2025
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 origin/main HEAD --extensions cpp,h -- llvm/tools/llvm-readobj/ELFDumper.cpp llvm/tools/llvm-readobj/ObjDumper.h llvm/tools/llvm-readobj/llvm-readobj.cpp
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index f4b449b0b..e23c95fe1 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -5223,7 +5223,6 @@ template <class ELFT> void GNUELFDumper<ELFT>::printCallGraphInfo() {
OS << "GNUStyle::printCallGraphInfo not implemented\n";
}
-
template <class ELFT>
void GNUELFDumper<ELFT>::printBBAddrMaps(bool /*PrettyPGOAnalysis*/) {
OS << "GNUStyle::printBBAddrMaps not implemented\n";
@@ -8115,7 +8114,7 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printCallGraphInfo() {
// TODO: some entries are written in pointer size. are they always 64-bit?
if (CGSecContents.size() % sizeof(uint64_t))
this->reportUniqueWarning(
- "Malformed .callgraph section. Unexpected size.");
+ "Malformed .callgraph section. Unexpected size.");
size_t Size = CGSecContents.size() / sizeof(uint64_t);
auto *It = reinterpret_cast<const uint64_t *>(CGSecContents.data());
@@ -8125,7 +8124,7 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printCallGraphInfo() {
auto CGNext = [&]() -> uint64_t {
if (!CGHasNext())
this->reportUniqueWarning(
- "Malformed .callgraph section. Parsing error.");
+ "Malformed .callgraph section. Parsing error.");
return *It++;
};
@@ -8135,7 +8134,7 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printCallGraphInfo() {
uint64_t FormatVersionNumber = CGNext();
if (FormatVersionNumber != 0)
this->reportUniqueWarning(
- "Unknown format version in .callgraph section.");
+ "Unknown format version in .callgraph section.");
// Function entry pc.
uint64_t FuncEntryPc = CGNext();
// Function kind.
@@ -8153,7 +8152,7 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printCallGraphInfo() {
break;
default:
this->reportUniqueWarning(
- "Unknown function kind in .callgraph section.");
+ "Unknown function kind in .callgraph section.");
}
// Read indirect call sites info.
@@ -8177,7 +8176,6 @@ template <class ELFT> void LLVMELFDumper<ELFT>::printCallGraphInfo() {
}
}
-
template <class ELFT>
void LLVMELFDumper<ELFT>::printBBAddrMaps(bool PrettyPGOAnalysis) {
bool IsRelocatable = this->Obj.getHeader().e_type == ELF::ET_REL;
``````````
</details>
https://github.com/llvm/llvm-project/pull/157499
More information about the llvm-commits
mailing list