[lld] r324944 - s/uncompress/decompress/g.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 12 13:56:14 PST 2018
Author: ruiu
Date: Mon Feb 12 13:56:14 2018
New Revision: 324944
URL: http://llvm.org/viewvc/llvm-project?rev=324944&view=rev
Log:
s/uncompress/decompress/g.
In lld, we use both "uncompress" and "decompress" which is confusing.
Since LLVM uses "decompress", we should use the same term.
Modified:
lld/trunk/ELF/GdbIndex.cpp
lld/trunk/ELF/InputSection.cpp
lld/trunk/ELF/InputSection.h
lld/trunk/ELF/SyntheticSections.cpp
Modified: lld/trunk/ELF/GdbIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/GdbIndex.cpp?rev=324944&r1=324943&r2=324944&view=diff
==============================================================================
--- lld/trunk/ELF/GdbIndex.cpp (original)
+++ lld/trunk/ELF/GdbIndex.cpp Mon Feb 12 13:56:14 2018
@@ -34,7 +34,7 @@ template <class ELFT> LLDDwarfObj<ELFT>:
.Case(".debug_ranges", &RangeSection)
.Case(".debug_line", &LineSection)
.Default(nullptr)) {
- Sec->maybeUncompress();
+ Sec->maybeDecompress();
M->Data = toStringRef(Sec->Data);
M->Sec = Sec;
continue;
Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=324944&r1=324943&r2=324944&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Mon Feb 12 13:56:14 2018
@@ -175,22 +175,22 @@ OutputSection *SectionBase::getOutputSec
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;
}
Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=324944&r1=324943&r2=324944&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Mon Feb 12 13:56:14 2018
@@ -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.
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=324944&r1=324943&r2=324944&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Feb 12 13:56:14 2018
@@ -2482,11 +2482,11 @@ static MergeSyntheticSection *createMerg
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();
});
}
More information about the llvm-commits
mailing list