Skip to content

Commit af84ed8

Browse files
authored
[ObjectYAML][NFC] Simplify ELFState<ELFT>::initProgramHeaders() (#123703)
This removes unused variables and dead code in the method.
1 parent c912e98 commit af84ed8

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/ObjectYAML/ELFEmitter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,11 @@ void ELFState<ELFT>::writeELFHeader(raw_ostream &OS) {
536536

537537
template <class ELFT>
538538
void ELFState<ELFT>::initProgramHeaders(std::vector<Elf_Phdr> &PHeaders) {
539-
DenseMap<StringRef, ELFYAML::Fill *> NameToFill;
540539
DenseMap<StringRef, size_t> NameToIndex;
541540
for (size_t I = 0, E = Doc.Chunks.size(); I != E; ++I) {
542-
if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get()))
543-
NameToFill[S->Name] = S;
544541
NameToIndex[Doc.Chunks[I]->Name] = I + 1;
545542
}
546543

547-
std::vector<ELFYAML::Section *> Sections = Doc.getSections();
548544
for (size_t I = 0, E = Doc.ProgramHeaders.size(); I != E; ++I) {
549545
ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I];
550546
Elf_Phdr Phdr;

0 commit comments

Comments
 (0)