[llvm] [BOLT] Fix comments for interprocedural branches. NFC (PR #170745)
Maksim Panchenko via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 4 13:14:11 PST 2025
https://github.com/maksfb created https://github.com/llvm/llvm-project/pull/170745
None
>From 7dbe74d9215418d28a6137bbb3f63c3b7a8cd679 Mon Sep 17 00:00:00 2001
From: Maksim Panchenko <maks at fb.com>
Date: Thu, 4 Dec 2025 13:10:06 -0800
Subject: [PATCH] [BOLT] Fix comments for interprocedural branches. NFC
---
bolt/include/bolt/Core/BinaryContext.h | 5 +++--
bolt/lib/Core/BinaryContext.cpp | 6 +++---
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 8a90febcea3cc..4872ccc0f5d7b 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -1113,7 +1113,7 @@ class BinaryContext {
return FragmentClasses.isEquivalent(LHS, RHS);
}
- /// Add interprocedural reference for \p Function to \p Address
+ /// Add interprocedural branch reference from \p Function to \p Address.
void addInterproceduralReference(BinaryFunction *Function, uint64_t Address) {
InterproceduralReferences.push_back({Function, Address});
}
@@ -1128,7 +1128,8 @@ class BinaryContext {
/// argument is false.
bool handleAArch64Veneer(uint64_t Address, bool MatchOnly = false);
- /// Resolve inter-procedural dependencies from
+ /// Resolve inter-procedural branch dependencies discovered during
+ /// disassembly.
void processInterproceduralReferences();
/// Skip functions with all parent and child fragments transitively.
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index 6a285f5538dbd..992663b86bdfe 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -1438,8 +1438,6 @@ void BinaryContext::processInterproceduralReferences() {
continue;
}
- // Check if address falls in function padding space - this could be
- // unmarked data in code. In this case adjust the padding space size.
ErrorOr<BinarySection &> Section = getSectionForAddress(Address);
assert(Section && "cannot get section for referenced address");
@@ -1451,7 +1449,7 @@ void BinaryContext::processInterproceduralReferences() {
if (SectionName == ".plt" || SectionName == ".plt.got")
continue;
- // Check if it is aarch64 veneer written at Address
+ // Check if it is aarch64 veneer written at Address.
if (isAArch64() && handleAArch64Veneer(Address))
continue;
@@ -1463,6 +1461,8 @@ void BinaryContext::processInterproceduralReferences() {
exit(1);
}
+ // Check if the address falls into the function padding space - this could
+ // be an unmarked data in code. In this case, adjust the padding space size.
TargetFunction = getBinaryFunctionContainingAddress(Address,
/*CheckPastEnd=*/false,
/*UseMaxSize=*/true);
More information about the llvm-commits
mailing list