[llvm] [BOLT][NFC] Adjust misleading comment & formatting (PR #88409)

Nathan Sidwell via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 09:25:44 PDT 2024


https://github.com/urnathan created https://github.com/llvm/llvm-project/pull/88409

This originally dealt with tbss, but now handles any bss-like section. So the comment is inaccurate. Also, the `{}` on the messaging seem unnecessary.

>From 818b41982f907771933ee7ec01e3bc31d56d8175 Mon Sep 17 00:00:00 2001
From: Nathan Sidwell <nathan at acm.org>
Date: Thu, 11 Apr 2024 09:26:55 -0400
Subject: [PATCH] [BOLT][NFC] Adjust misleading comment & formatting

---
 bolt/lib/Rewrite/RewriteInstance.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 0c8ee0d417233b..93017d58f488b3 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -4298,7 +4298,7 @@ RewriteInstance::getOutputSections(ELFObjectFile<ELFT> *File,
   for (auto &SectionKV : OutputSections) {
     ELFShdrTy &Section = SectionKV.second;
 
-    // Ignore TLS sections as they don't take any space in the file.
+    // Ignore NOBITS sections as they don't take any space in the file.
     if (Section.sh_type == ELF::SHT_NOBITS)
       continue;
 
@@ -4306,10 +4306,9 @@ RewriteInstance::getOutputSections(ELFObjectFile<ELFT> *File,
     // placed in different loadable segments.
     if (PrevSection &&
         PrevSection->sh_offset + PrevSection->sh_size > Section.sh_offset) {
-      if (opts::Verbosity > 1) {
+      if (opts::Verbosity > 1)
         BC->outs() << "BOLT-INFO: adjusting size for section "
                    << PrevBinSec->getOutputName() << '\n';
-      }
       PrevSection->sh_size = Section.sh_offset - PrevSection->sh_offset;
     }
 



More information about the llvm-commits mailing list