[llvm] 9c46718 - [SampleProfile] Apply minor readability cleanups (#217878)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 21:43:49 PDT 2026


Author: Sergey Shcherbinin
Date: 2026-08-26T08:43:44+04:00
New Revision: 9c4671848d867ae13f0f18acf548784296a40d9a

URL: https://github.com/llvm/llvm-project/commit/9c4671848d867ae13f0f18acf548784296a40d9a
DIFF: https://github.com/llvm/llvm-project/commit/9c4671848d867ae13f0f18acf548784296a40d9a.diff

LOG: [SampleProfile] Apply minor readability cleanups (#217878)

Added: 
    

Modified: 
    llvm/lib/ProfileData/SampleProfWriter.cpp
    llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
index ce37ba03a3d43..2d317a7f6f744 100644
--- a/llvm/lib/ProfileData/SampleProfWriter.cpp
+++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
@@ -177,7 +177,7 @@ SampleProfileWriterExtBinaryBase::markSectionStart(SecType Type,
   assert(LayoutIdx < SectionHdrLayout.size() && "LayoutIdx out of range");
   const auto &Entry = SectionHdrLayout[LayoutIdx];
   assert(Entry.Type == Type && "Unexpected section type");
-  // Use LocalBuf as a temporary output for writting data.
+  // Use LocalBuf as a temporary output for writing data.
   if (hasSecFlag(Entry, SecCommonFlags::SecFlagCompress))
     LocalBufStream.swap(OutputStream);
   return SectionStart;
@@ -188,7 +188,7 @@ std::error_code SampleProfileWriterExtBinaryBase::compressAndOutput() {
     return sampleprof_error::zlib_unavailable;
   std::string &UncompressedStrings =
       static_cast<raw_string_ostream *>(LocalBufStream.get())->str();
-  if (UncompressedStrings.size() == 0)
+  if (UncompressedStrings.empty())
     return sampleprof_error::success;
   auto &OS = *OutputStream;
   SmallVector<uint8_t, 128> CompressedStrings;

diff  --git a/llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test b/llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test
index 62646d5bf43bf..5dea26189b807 100644
--- a/llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test
+++ b/llvm/test/tools/llvm-profdata/eytzinger-split-nametable-partition.test
@@ -4,7 +4,7 @@
 # RUN: FileCheck %s -input-file %t.secinfo
 # RUN: llvm-profdata merge --sample --text %t.xfdo -o %t.text
 # RUN: FileCheck %s --check-prefix=TEXT -input-file %t.text
-# Extract and verify the Eytzinger span counts (NumCS, NumFlat,
+# Extract and verify the Eytzinger span counts (NumNested, NumFlat,
 # NumInlinees) from NameTableSection to ensure correct symbol
 # partitioning.
 # RUN: %python -c "import re; off = int(re.search(r'NameTableSection - Offset: (\d+)', open(r'%t.secinfo').read()).group(1)); d = open(r'%t.xfdo', 'rb').read()[off:off+3]; print(list(d))" | FileCheck %s --check-prefix=COUNTS


        


More information about the llvm-commits mailing list