From 67df0dc3bac0462137d34bc2cdb315634a2dae97 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 14 Nov 2024 22:11:07 +0900 Subject: s/CustomRawContentSection/CustomSection/ --- llvm/include/llvm/ObjectYAML/ELFYAML.h | 14 +++++++------- llvm/lib/ObjectYAML/ELFEmitter.cpp | 10 +++++----- llvm/lib/ObjectYAML/ELFYAML.cpp | 10 +++++----- llvm/tools/obj2yaml/elf2yaml.cpp | 11 +++++------ 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/llvm/include/llvm/ObjectYAML/ELFYAML.h b/llvm/include/llvm/ObjectYAML/ELFYAML.h index 59af9ac8851c..38497c813c0f 100644 --- a/llvm/include/llvm/ObjectYAML/ELFYAML.h +++ b/llvm/include/llvm/ObjectYAML/ELFYAML.h @@ -211,7 +211,7 @@ struct Chunk { Dynamic, Group, RawContent, - CustomRawContent, + CustomContent, Relocation, Relr, NoBits, @@ -400,10 +400,10 @@ struct RawContentSection : Section { }; /// Abstract base class for non-blob contents. -struct CustomRawContentSection : Section { +struct CustomSection : Section { std::optional Info; - CustomRawContentSection() : Section(ChunkKind::CustomRawContent) {} + CustomSection() : Section(ChunkKind::CustomContent) {} /// Apply mappings. virtual void sectionMapping(yaml::IO &IO) = 0; @@ -415,7 +415,7 @@ struct CustomRawContentSection : Section { virtual std::string encode() const = 0; static bool classof(const Chunk *S) { - return S->Kind == ChunkKind::CustomRawContent; + return S->Kind == ChunkKind::CustomContent; } }; @@ -796,14 +796,14 @@ public: } ~Opt(); - /// Create an empty new object of CustomRawContentSection. + /// Create an empty new object of CustomSection. /// Its contents will be filled later. /// This is called: /// - Before preMapping for elf2yaml. /// - After preMapping for yaml2elf. /// Returns nullptr to delegate default actions. - virtual std::unique_ptr - makeCustomRawContentSection(StringRef Name) const; + virtual std::unique_ptr + makeCustomSection(StringRef Name) const; /// Called before mapping sections for prettyprinting yaml. virtual void preMapping(const ELFYAML::Object &Object, bool IsOutputting); diff --git a/llvm/lib/ObjectYAML/ELFEmitter.cpp b/llvm/lib/ObjectYAML/ELFEmitter.cpp index 1c7297bf5f09..f70f9e560140 100644 --- a/llvm/lib/ObjectYAML/ELFEmitter.cpp +++ b/llvm/lib/ObjectYAML/ELFEmitter.cpp @@ -252,7 +252,7 @@ template class ELFState { const ELFYAML::NoBitsSection &Section, ContiguousBlobAccumulator &CBA); void writeSectionContent(Elf_Shdr &SHeader, - const ELFYAML::CustomRawContentSection &Section, + const ELFYAML::CustomSection &Section, ContiguousBlobAccumulator &CBA); void writeSectionContent(Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, @@ -862,7 +862,7 @@ void ELFState::initSectionHeaders(std::vector &SHeaders, if (!isa(Sec) && (Sec->Content || Sec->Size)) SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size); - if (auto S = dyn_cast(Sec)) { + if (auto S = dyn_cast(Sec)) { writeSectionContent(SHeader, *S, CBA); } else if (auto S = dyn_cast(Sec)) { writeSectionContent(SHeader, *S, CBA); @@ -1270,9 +1270,9 @@ void ELFState::writeSectionContent( } template -void ELFState::writeSectionContent( - Elf_Shdr &SHeader, const ELFYAML::CustomRawContentSection &Section, - ContiguousBlobAccumulator &CBA) { +void ELFState::writeSectionContent(Elf_Shdr &SHeader, + const ELFYAML::CustomSection &Section, + ContiguousBlobAccumulator &CBA) { if (Section.Info) SHeader.sh_info = *Section.Info; diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp index 83ee88e57d66..3f73637929ca 100644 --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -32,8 +32,8 @@ ELFYAML::Chunk::~Chunk() = default; ELFYAML::Opt::~Opt() = default; const char ELFYAML::Opt::ID = 'E'; -std::unique_ptr -ELFYAML::Opt::makeCustomRawContentSection(StringRef Name) const { +std::unique_ptr +ELFYAML::Opt::makeCustomSection(StringRef Name) const { return nullptr; } @@ -1599,11 +1599,11 @@ static bool isInteger(StringRef Val) { void MappingTraits>::mapping( IO &IO, std::unique_ptr &Section) { if (!IO.outputting()) { - /// Prepare CustomRawContentSection by Name for ELFEmitter. + /// Prepare CustomSection by Name for ELFEmitter. if (auto *Opt = dyn_cast(IO.Opt)) { StringRef Name; IO.mapOptional("Name", Name); - if (auto S = Opt->makeCustomRawContentSection(Name)) { + if (auto S = Opt->makeCustomSection(Name)) { commonSectionMapping(IO, *S); S->sectionMapping(IO); Section = std::move(S); @@ -1761,7 +1761,7 @@ void MappingTraits>::mapping( Section = std::make_unique(); } - if (auto S = dyn_cast(Section.get())) { + if (auto S = dyn_cast(Section.get())) { commonSectionMapping(IO, *S); S->sectionMapping(IO); } else if (auto S = dyn_cast(Section.get())) diff --git a/llvm/tools/obj2yaml/elf2yaml.cpp b/llvm/tools/obj2yaml/elf2yaml.cpp index d3fbe9c2d17c..8567de489a0b 100644 --- a/llvm/tools/obj2yaml/elf2yaml.cpp +++ b/llvm/tools/obj2yaml/elf2yaml.cpp @@ -81,8 +81,7 @@ class ELFDumper { Expected dumpRelrSection(const Elf_Shdr *Shdr); Expected dumpContentSection(const Elf_Shdr *Shdr); - Expected - dumpCustomRawContentSection(const Elf_Shdr *Shdr); + Expected dumpCustomSection(const Elf_Shdr *Shdr); Expected dumpSymtabShndxSection(const Elf_Shdr *Shdr); Expected dumpNoBitsSection(const Elf_Shdr *Shdr); @@ -662,7 +661,7 @@ ELFDumper::dumpSections() { if (!NameOrErr) return NameOrErr.takeError(); - if (auto ResultOrErr = dumpCustomRawContentSection(&Sec)) { + if (auto ResultOrErr = dumpCustomSection(&Sec)) { auto *Ptr = *ResultOrErr; if (Ptr) { if (Error E = Add(Ptr)) @@ -1672,14 +1671,14 @@ ELFDumper::dumpMipsABIFlags(const Elf_Shdr *Shdr) { } template -Expected -ELFDumper::dumpCustomRawContentSection(const Elf_Shdr *Shdr) { +Expected +ELFDumper::dumpCustomSection(const Elf_Shdr *Shdr) { Expected NameOrErr = getUniquedSectionName(*Shdr); if (Error E = NameOrErr.takeError()) return nullptr; auto Name = std::move(*NameOrErr); - auto S = Opt.makeCustomRawContentSection(Name); + auto S = Opt.makeCustomSection(Name); if (!S) return nullptr; -- cgit v1.2.3