[llvm] [llvm-size] Fix --totals option for Mach-O files (PR #157904)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 01:01:03 PDT 2025


================
@@ -852,16 +866,25 @@ static void printBerkeleyTotals() {
   std::string fmtbuf;
   raw_string_ostream fmt(fmtbuf);
   const char *radix_fmt = getRadixFmt();
-  fmt << "%#7" << radix_fmt << "\t"
-      << "%#7" << radix_fmt << "\t"
-      << "%#7" << radix_fmt << "\t";
-  outs() << format(fmtbuf.c_str(), TotalObjectText, TotalObjectData,
-                   TotalObjectBss);
-  fmtbuf.clear();
-  fmt << "%7" << (Radix == octal ? PRIo64 : PRIu64) << "\t"
-      << "%7" PRIx64 "\t";
-  outs() << format(fmtbuf.c_str(), TotalObjectTotal, TotalObjectTotal)
-         << "(TOTALS)\n";
+
+  if (HasMachOFiles) {
----------------
jh7370 wrote:

Sorry, I didn't register when I made this comment that the header printing was independent. Let's not worry about that now.

https://github.com/llvm/llvm-project/pull/157904


More information about the llvm-commits mailing list