s/uncompress/decompress/g.
authorRui Ueyama <ruiu@google.com>
Mon, 12 Feb 2018 21:56:14 +0000 (21:56 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 12 Feb 2018 21:56:14 +0000 (21:56 +0000)
In lld, we use both "uncompress" and "decompress" which is confusing.
Since LLVM uses "decompress", we should use the same term.

llvm-svn: 324944

lld/ELF/GdbIndex.cpp
lld/ELF/InputSection.cpp
lld/ELF/InputSection.h
lld/ELF/SyntheticSections.cpp

index d27b57f..85449a2 100644 (file)
@@ -34,7 +34,7 @@ template <class ELFT> LLDDwarfObj<ELFT>::LLDDwarfObj(ObjFile<ELFT> *Obj) {
                                  .Case(".debug_ranges", &RangeSection)
                                  .Case(".debug_line", &LineSection)
                                  .Default(nullptr)) {
-      Sec->maybeUncompress();
+      Sec->maybeDecompress();
       M->Data = toStringRef(Sec->Data);
       M->Sec = Sec;
       continue;
index 428637a..c9a66f0 100644 (file)
@@ -175,22 +175,22 @@ OutputSection *SectionBase::getOutputSection() {
   return Sec ? Sec->getParent() : nullptr;
 }
 
-// Uncompress section contents if required. Note that this function
+// Decompress section contents if required. Note that this function
 // is called from parallelForEach, so it must be thread-safe.
-void InputSectionBase::maybeUncompress() {
-  if (UncompressBuf || !Decompressor::isCompressedELFSection(Flags, Name))
+void InputSectionBase::maybeDecompress() {
+  if (DecompressBuf || !Decompressor::isCompressedELFSection(Flags, Name))
     return;
 
   Decompressor Dec = check(Decompressor::create(Name, toStringRef(Data),
                                                 Config->IsLE, Config->Is64));
 
   size_t Size = Dec.getDecompressedSize();
-  UncompressBuf.reset(new char[Size]());
-  if (Error E = Dec.decompress({UncompressBuf.get(), Size}))
+  DecompressBuf.reset(new char[Size]());
+  if (Error E = Dec.decompress({DecompressBuf.get(), Size}))
     fatal(toString(this) +
           ": decompress failed: " + llvm::toString(std::move(E)));
 
-  Data = makeArrayRef((uint8_t *)UncompressBuf.get(), Size);
+  Data = makeArrayRef((uint8_t *)DecompressBuf.get(), Size);
   Flags &= ~(uint64_t)SHF_COMPRESSED;
 }
 
index 7c0c611..58549c3 100644 (file)
@@ -164,7 +164,7 @@ public:
   // Compilers emit zlib-compressed debug sections if the -gz option
   // is given. This function checks if this section is compressed, and
   // if so, decompress in memory.
-  void maybeUncompress();
+  void maybeDecompress();
 
   // Returns a source location string. Used to construct an error message.
   template <class ELFT> std::string getLocation(uint64_t Offset);
@@ -189,9 +189,9 @@ public:
   }
 
 private:
-  // A pointer that owns uncompressed data if a section is compressed by zlib.
+  // A pointer that owns decompressed data if a section is compressed by zlib.
   // Since the feature is not used often, this is usually a nullptr.
-  std::unique_ptr<char[]> UncompressBuf;
+  std::unique_ptr<char[]> DecompressBuf;
 };
 
 // SectionPiece represents a piece of splittable section contents.
index 17341f3..3a0922f 100644 (file)
@@ -2482,11 +2482,11 @@ static MergeSyntheticSection *createMergeSynthetic(StringRef Name,
   return make<MergeNoTailSection>(Name, Type, Flags, Alignment);
 }
 
-// Debug sections may be compressed by zlib. Uncompress if exists.
+// Debug sections may be compressed by zlib. Decompress if exists.
 void elf::decompressSections() {
   parallelForEach(InputSections, [](InputSectionBase *Sec) {
     if (Sec->Live)
-      Sec->maybeUncompress();
+      Sec->maybeDecompress();
   });
 }