Skip to content

Commit 67df0dc

Browse files
committed
s/CustomRawContentSection/CustomSection/
1 parent 9f7a0c4 commit 67df0dc

File tree

4 files changed

+22
-23
lines changed

4 files changed

+22
-23
lines changed

llvm/include/llvm/ObjectYAML/ELFYAML.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ struct Chunk {
211211
Dynamic,
212212
Group,
213213
RawContent,
214-
CustomRawContent,
214+
CustomContent,
215215
Relocation,
216216
Relr,
217217
NoBits,
@@ -400,10 +400,10 @@ struct RawContentSection : Section {
400400
};
401401

402402
/// Abstract base class for non-blob contents.
403-
struct CustomRawContentSection : Section {
403+
struct CustomSection : Section {
404404
std::optional<llvm::yaml::Hex64> Info;
405405

406-
CustomRawContentSection() : Section(ChunkKind::CustomRawContent) {}
406+
CustomSection() : Section(ChunkKind::CustomContent) {}
407407

408408
/// Apply mappings.
409409
virtual void sectionMapping(yaml::IO &IO) = 0;
@@ -415,7 +415,7 @@ struct CustomRawContentSection : Section {
415415
virtual std::string encode() const = 0;
416416

417417
static bool classof(const Chunk *S) {
418-
return S->Kind == ChunkKind::CustomRawContent;
418+
return S->Kind == ChunkKind::CustomContent;
419419
}
420420
};
421421

@@ -796,14 +796,14 @@ class Opt : public yaml::IO::OptBase {
796796
}
797797
~Opt();
798798

799-
/// Create an empty new object of CustomRawContentSection.
799+
/// Create an empty new object of CustomSection.
800800
/// Its contents will be filled later.
801801
/// This is called:
802802
/// - Before preMapping for elf2yaml.
803803
/// - After preMapping for yaml2elf.
804804
/// Returns nullptr to delegate default actions.
805-
virtual std::unique_ptr<CustomRawContentSection>
806-
makeCustomRawContentSection(StringRef Name) const;
805+
virtual std::unique_ptr<CustomSection>
806+
makeCustomSection(StringRef Name) const;
807807

808808
/// Called before mapping sections for prettyprinting yaml.
809809
virtual void preMapping(const ELFYAML::Object &Object, bool IsOutputting);

llvm/lib/ObjectYAML/ELFEmitter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ template <class ELFT> class ELFState {
252252
const ELFYAML::NoBitsSection &Section,
253253
ContiguousBlobAccumulator &CBA);
254254
void writeSectionContent(Elf_Shdr &SHeader,
255-
const ELFYAML::CustomRawContentSection &Section,
255+
const ELFYAML::CustomSection &Section,
256256
ContiguousBlobAccumulator &CBA);
257257
void writeSectionContent(Elf_Shdr &SHeader,
258258
const ELFYAML::RawContentSection &Section,
@@ -862,7 +862,7 @@ void ELFState<ELFT>::initSectionHeaders(std::vector<Elf_Shdr> &SHeaders,
862862
if (!isa<ELFYAML::NoBitsSection>(Sec) && (Sec->Content || Sec->Size))
863863
SHeader.sh_size = writeContent(CBA, Sec->Content, Sec->Size);
864864

865-
if (auto S = dyn_cast<ELFYAML::CustomRawContentSection>(Sec)) {
865+
if (auto S = dyn_cast<ELFYAML::CustomSection>(Sec)) {
866866
writeSectionContent(SHeader, *S, CBA);
867867
} else if (auto S = dyn_cast<ELFYAML::RawContentSection>(Sec)) {
868868
writeSectionContent(SHeader, *S, CBA);
@@ -1270,9 +1270,9 @@ void ELFState<ELFT>::writeSectionContent(
12701270
}
12711271

12721272
template <class ELFT>
1273-
void ELFState<ELFT>::writeSectionContent(
1274-
Elf_Shdr &SHeader, const ELFYAML::CustomRawContentSection &Section,
1275-
ContiguousBlobAccumulator &CBA) {
1273+
void ELFState<ELFT>::writeSectionContent(Elf_Shdr &SHeader,
1274+
const ELFYAML::CustomSection &Section,
1275+
ContiguousBlobAccumulator &CBA) {
12761276
if (Section.Info)
12771277
SHeader.sh_info = *Section.Info;
12781278

llvm/lib/ObjectYAML/ELFYAML.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ELFYAML::Chunk::~Chunk() = default;
3232
ELFYAML::Opt::~Opt() = default;
3333
const char ELFYAML::Opt::ID = 'E';
3434

35-
std::unique_ptr<ELFYAML::CustomRawContentSection>
36-
ELFYAML::Opt::makeCustomRawContentSection(StringRef Name) const {
35+
std::unique_ptr<ELFYAML::CustomSection>
36+
ELFYAML::Opt::makeCustomSection(StringRef Name) const {
3737
return nullptr;
3838
}
3939

@@ -1599,11 +1599,11 @@ static bool isInteger(StringRef Val) {
15991599
void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
16001600
IO &IO, std::unique_ptr<ELFYAML::Chunk> &Section) {
16011601
if (!IO.outputting()) {
1602-
/// Prepare CustomRawContentSection by Name for ELFEmitter.
1602+
/// Prepare CustomSection by Name for ELFEmitter.
16031603
if (auto *Opt = dyn_cast<ELFYAML::Opt>(IO.Opt)) {
16041604
StringRef Name;
16051605
IO.mapOptional("Name", Name);
1606-
if (auto S = Opt->makeCustomRawContentSection(Name)) {
1606+
if (auto S = Opt->makeCustomSection(Name)) {
16071607
commonSectionMapping(IO, *S);
16081608
S->sectionMapping(IO);
16091609
Section = std::move(S);
@@ -1761,7 +1761,7 @@ void MappingTraits<std::unique_ptr<ELFYAML::Chunk>>::mapping(
17611761
Section = std::make_unique<ELFYAML::RawContentSection>();
17621762
}
17631763

1764-
if (auto S = dyn_cast<ELFYAML::CustomRawContentSection>(Section.get())) {
1764+
if (auto S = dyn_cast<ELFYAML::CustomSection>(Section.get())) {
17651765
commonSectionMapping(IO, *S);
17661766
S->sectionMapping(IO);
17671767
} else if (auto S = dyn_cast<ELFYAML::RawContentSection>(Section.get()))

llvm/tools/obj2yaml/elf2yaml.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ class ELFDumper {
8181
Expected<ELFYAML::RelrSection *> dumpRelrSection(const Elf_Shdr *Shdr);
8282
Expected<ELFYAML::RawContentSection *>
8383
dumpContentSection(const Elf_Shdr *Shdr);
84-
Expected<ELFYAML::CustomRawContentSection *>
85-
dumpCustomRawContentSection(const Elf_Shdr *Shdr);
84+
Expected<ELFYAML::CustomSection *> dumpCustomSection(const Elf_Shdr *Shdr);
8685
Expected<ELFYAML::SymtabShndxSection *>
8786
dumpSymtabShndxSection(const Elf_Shdr *Shdr);
8887
Expected<ELFYAML::NoBitsSection *> dumpNoBitsSection(const Elf_Shdr *Shdr);
@@ -662,7 +661,7 @@ ELFDumper<ELFT>::dumpSections() {
662661
if (!NameOrErr)
663662
return NameOrErr.takeError();
664663

665-
if (auto ResultOrErr = dumpCustomRawContentSection(&Sec)) {
664+
if (auto ResultOrErr = dumpCustomSection(&Sec)) {
666665
auto *Ptr = *ResultOrErr;
667666
if (Ptr) {
668667
if (Error E = Add(Ptr))
@@ -1672,14 +1671,14 @@ ELFDumper<ELFT>::dumpMipsABIFlags(const Elf_Shdr *Shdr) {
16721671
}
16731672

16741673
template <class ELFT>
1675-
Expected<ELFYAML::CustomRawContentSection *>
1676-
ELFDumper<ELFT>::dumpCustomRawContentSection(const Elf_Shdr *Shdr) {
1674+
Expected<ELFYAML::CustomSection *>
1675+
ELFDumper<ELFT>::dumpCustomSection(const Elf_Shdr *Shdr) {
16771676
Expected<StringRef> NameOrErr = getUniquedSectionName(*Shdr);
16781677
if (Error E = NameOrErr.takeError())
16791678
return nullptr;
16801679
auto Name = std::move(*NameOrErr);
16811680

1682-
auto S = Opt.makeCustomRawContentSection(Name);
1681+
auto S = Opt.makeCustomSection(Name);
16831682
if (!S)
16841683
return nullptr;
16851684

0 commit comments

Comments
 (0)