forked from OSchip/llvm-project
[Support] Rename DebugCompressionType::Z to Zlib
"Z" was so named when we had both gABI ELFCOMPRESS_ZLIB and the legacy .zdebug support. Now we have just one zlib format, we should use the more descriptive name.
This commit is contained in:
parent
580f725d48
commit
781dea021a
|
@ -239,7 +239,7 @@ bool AssemblerInvocation::CreateFromArgs(AssemblerInvocation &Opts,
|
|||
Opts.CompressDebugSections =
|
||||
llvm::StringSwitch<llvm::DebugCompressionType>(A->getValue())
|
||||
.Case("none", llvm::DebugCompressionType::None)
|
||||
.Case("zlib", llvm::DebugCompressionType::Z)
|
||||
.Case("zlib", llvm::DebugCompressionType::Zlib)
|
||||
.Default(llvm::DebugCompressionType::None);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class Error;
|
|||
// compression::Format members for non-debugging purposes.
|
||||
enum class DebugCompressionType {
|
||||
None, ///< No compression
|
||||
Z, ///< zlib
|
||||
Zlib, ///< zlib
|
||||
Zstd, ///< Zstandard
|
||||
};
|
||||
|
||||
|
@ -84,7 +84,7 @@ inline Format formatFor(DebugCompressionType Type) {
|
|||
switch (Type) {
|
||||
case DebugCompressionType::None:
|
||||
llvm_unreachable("not a compression type");
|
||||
case DebugCompressionType::Z:
|
||||
case DebugCompressionType::Zlib:
|
||||
return Format::Zlib;
|
||||
case DebugCompressionType::Zstd:
|
||||
return Format::Zstd;
|
||||
|
|
|
@ -867,7 +867,7 @@ void ELFWriter::writeSectionData(const MCAssembler &Asm, MCSection &Sec,
|
|||
switch (CompressionType) {
|
||||
case DebugCompressionType::None:
|
||||
llvm_unreachable("has been handled");
|
||||
case DebugCompressionType::Z:
|
||||
case DebugCompressionType::Zlib:
|
||||
ChType = ELF::ELFCOMPRESS_ZLIB;
|
||||
break;
|
||||
case DebugCompressionType::Zstd:
|
||||
|
|
|
@ -442,7 +442,7 @@ Error ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) {
|
|||
DebugCompressionType Type;
|
||||
switch (Sec.ChType) {
|
||||
case ELFCOMPRESS_ZLIB:
|
||||
Type = DebugCompressionType::Z;
|
||||
Type = DebugCompressionType::Zlib;
|
||||
break;
|
||||
case ELFCOMPRESS_ZSTD:
|
||||
Type = DebugCompressionType::Zstd;
|
||||
|
@ -510,7 +510,7 @@ Error ELFSectionWriter<ELFT>::visit(const CompressedSection &Sec) {
|
|||
case DebugCompressionType::None:
|
||||
std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), Buf);
|
||||
return Error::success();
|
||||
case DebugCompressionType::Z:
|
||||
case DebugCompressionType::Zlib:
|
||||
Chdr.ch_type = ELF::ELFCOMPRESS_ZLIB;
|
||||
break;
|
||||
case DebugCompressionType::Zstd:
|
||||
|
|
|
@ -76,7 +76,7 @@ static cl::opt<DebugCompressionType> CompressDebugSections(
|
|||
cl::init(DebugCompressionType::None),
|
||||
cl::desc("Choose DWARF debug sections compression:"),
|
||||
cl::values(clEnumValN(DebugCompressionType::None, "none", "No compression"),
|
||||
clEnumValN(DebugCompressionType::Z, "zlib", "Use zlib"),
|
||||
clEnumValN(DebugCompressionType::Zlib, "zlib", "Use zlib"),
|
||||
clEnumValN(DebugCompressionType::Zstd, "zstd", "Use zstd")),
|
||||
cl::cat(MCCategory));
|
||||
|
||||
|
|
|
@ -720,7 +720,7 @@ objcopy::parseObjcopyOptions(ArrayRef<const char *> RawArgsArr,
|
|||
|
||||
if (const auto *A = InputArgs.getLastArg(OBJCOPY_compress_debug_sections)) {
|
||||
Config.CompressionType = StringSwitch<DebugCompressionType>(A->getValue())
|
||||
.Case("zlib", DebugCompressionType::Z)
|
||||
.Case("zlib", DebugCompressionType::Zlib)
|
||||
.Case("zstd", DebugCompressionType::Zstd)
|
||||
.Default(DebugCompressionType::None);
|
||||
if (Config.CompressionType == DebugCompressionType::None) {
|
||||
|
|
|
@ -34,8 +34,8 @@ static void testZlibCompression(StringRef Input, int Level) {
|
|||
EXPECT_EQ(Input, toStringRef(Uncompressed));
|
||||
|
||||
// decompress with Z dispatches to zlib::uncompress.
|
||||
E = compression::decompress(DebugCompressionType::Z, Compressed, Uncompressed,
|
||||
Input.size());
|
||||
E = compression::decompress(DebugCompressionType::Zlib, Compressed,
|
||||
Uncompressed, Input.size());
|
||||
EXPECT_FALSE(std::move(E));
|
||||
EXPECT_EQ(Input, toStringRef(Uncompressed));
|
||||
|
||||
|
|
Loading…
Reference in New Issue