[llvm] [llvm-objdump] Handle .callgraph section (PR #151009)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 28 11:15:00 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 HEAD~1 HEAD --extensions cpp -- llvm/tools/llvm-objdump/llvm-objdump.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp
index c42d71030..2679cb1bc 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -2440,10 +2440,10 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
}
// Check if the assumption holds true.
assert(HasRegOperand ||
- (!HasRegOperand && ImmOperandCount == 1) &&
- "Call instruction is expected to have at least one "
- "register operand (i.e., indirect call) or exactly "
- "one immediate operand (i.e., direct call).");
+ (!HasRegOperand && ImmOperandCount == 1) &&
+ "Call instruction is expected to have at least one "
+ "register operand (i.e., indirect call) or exactly "
+ "one immediate operand (i.e., direct call).");
if (HasRegOperand) {
// Indirect call.
IndirectCallSites.insert(CallSitePc);
@@ -2452,21 +2452,21 @@ disassembleObject(ObjectFile &Obj, const ObjectFile &DbgObj,
// Direct call.
uint64_t CalleePc;
bool Res = MIA->evaluateBranch(Inst, SectionAddr + Index, Size,
- CalleePc);
+ CalleePc);
assert(Res && "Failed to evaluate direct call target address.");
FuncInfo[CallerPc].DirectCallSites.emplace_back(CallSitePc,
CalleePc);
}
- if(FuncInfo[CallerPc].Name.empty()) {
+ if (FuncInfo[CallerPc].Name.empty()) {
for (size_t Index = 0; Index < SymbolsHere.size(); ++Index) {
if (SymbolsHere[Index].Addr == CallerPc) {
FuncInfo[CallerPc].Name = SymNamesHere[Index];
}
- }
- }
+ }
+ }
}
- }
+ }
DT->InstPrinter->setCommentStream(CommentStream);
``````````
</details>
https://github.com/llvm/llvm-project/pull/151009
More information about the llvm-commits
mailing list