[lld] c682c26 - [ELF] Rename InputSectionBase::uncompress to decompress. NFC

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 9 10:18:53 PDT 2022


Author: Fangrui Song
Date: 2022-09-09T10:18:46-07:00
New Revision: c682c26942ea4bb6b01f24394d8305cf07cb1e68

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

LOG: [ELF] Rename InputSectionBase::uncompress to decompress. NFC

The canonical verb is "decompress" (also used in llvm-objcopy). "uncompressed"
describes the state.

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp
    lld/ELF/InputSection.h
    lld/test/ELF/compressed-input-err.s

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 71810316eee39..b3ec3f7328413 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -110,7 +110,7 @@ size_t InputSectionBase::getSize() const {
   return rawData.size() - bytesDropped;
 }
 
-void InputSectionBase::uncompress() const {
+void InputSectionBase::decompress() const {
   size_t size = uncompressedSize;
   uint8_t *uncompressedBuf;
   {
@@ -121,7 +121,7 @@ void InputSectionBase::uncompress() const {
 
   if (Error e = compression::zlib::uncompress(rawData, uncompressedBuf, size))
     fatal(toString(this) +
-          ": uncompress failed: " + llvm::toString(std::move(e)));
+          ": decompress failed: " + llvm::toString(std::move(e)));
   rawData = makeArrayRef(uncompressedBuf, size);
   uncompressedSize = -1;
 }
@@ -1222,7 +1222,7 @@ template <class ELFT> void InputSection::writeTo(uint8_t *buf) {
     size_t size = uncompressedSize;
     if (Error e = compression::zlib::uncompress(rawData, buf, size))
       fatal(toString(this) +
-            ": uncompress failed: " + llvm::toString(std::move(e)));
+            ": decompress failed: " + llvm::toString(std::move(e)));
     uint8_t *bufEnd = buf + size;
     relocate<ELFT>(buf, bufEnd);
     return;

diff  --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 2cdba943eb28e..ce1cdc75cb014 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -163,7 +163,7 @@ class InputSectionBase : public SectionBase {
 
   ArrayRef<uint8_t> data() const {
     if (uncompressedSize >= 0)
-      uncompress();
+      decompress();
     return rawData;
   }
 
@@ -234,7 +234,7 @@ class InputSectionBase : public SectionBase {
 protected:
   template <typename ELFT>
   void parseCompressedHeader();
-  void uncompress() const;
+  void decompress() const;
 
   // This field stores the uncompressed size of the compressed data in rawData,
   // or -1 if rawData is not compressed (either because the section wasn't

diff  --git a/lld/test/ELF/compressed-input-err.s b/lld/test/ELF/compressed-input-err.s
index 8c34bbe41b190..83b1f62d7e495 100644
--- a/lld/test/ELF/compressed-input-err.s
+++ b/lld/test/ELF/compressed-input-err.s
@@ -10,8 +10,8 @@
 # RUN: yaml2obj --docnum=3 %s -o %t3.o
 # RUN: not ld.lld %t3.o -o /dev/null -shared 2>&1 | FileCheck %s
 
-## Check we are able to report zlib uncompress errors.
-# CHECK: error: {{.*}}.o:(.debug_info): uncompress failed: zlib error: Z_DATA_ERROR
+## Check we are able to report zlib decompress errors.
+# CHECK: error: {{.*}}.o:(.debug_info): decompress failed: zlib error: Z_DATA_ERROR
 
 --- !ELF
 FileHeader:


        


More information about the llvm-commits mailing list