[llvm] [BOLT] Add x86-64 large code model support (.ltext sections) (PR #190637)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 10:45:17 PDT 2026
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 -- bolt/include/bolt/Core/BinaryContext.h bolt/lib/Core/BinaryContext.cpp bolt/lib/Passes/BinaryPasses.cpp bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp bolt/lib/Rewrite/RewriteInstance.cpp bolt/unittests/Core/BinaryContext.cpp --diff_from_common_commit
``````````
: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/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index d4b9418d6..9cedb98e2 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -2244,7 +2244,8 @@ Error RewriteInstance::readSpecialSections() {
// Detect large code model sections (.ltext).
if (BC->getUniqueSectionByName(BC->getLargeMainCodeSectionName())) {
BC->HasLargeCodeModel = true;
- BC->outs() << "BOLT-INFO: large code model detected (.ltext section found)\n";
+ BC->outs()
+ << "BOLT-INFO: large code model detected (.ltext section found)\n";
// Update LSDA encoding for large code model — use 8-byte pointers so that
// exception handling works for functions at addresses above 2GB.
@@ -3995,8 +3996,7 @@ void RewriteInstance::emitAndLink() {
BC->getUniqueSectionByName(BC->getLargeMainCodeSectionName());
if (LTextSection)
BC->renameSection(*LTextSection,
- getOrgSecPrefix() +
- BC->getLargeMainCodeSectionName());
+ getOrgSecPrefix() + BC->getLargeMainCodeSectionName());
}
//////////////////////////////////////////////////////////////////////////////
``````````
</details>
https://github.com/llvm/llvm-project/pull/190637
More information about the llvm-commits
mailing list